Cascading style sheets (CSS) provide web designers with precise control over their products' visual appearance, which can be enormously beneficial for digital accessibility.
By using CSS for visual styling — rather than relying on HTML/XHTML alone — you can achieve virtually any aesthetic effect while still providing every component with correct semantics and structure. This is important because assistive technologies (AT) rely on accurate semantics to operate predictably. If your website uses HTML markup for styling, the user experience can suffer.
The best practice is to structure your website with HTML, then use CSS for visual styling. Below, we’ll explain a few advantages of this approach.
The most important advantage of CSS is that it separates content from its presentation. As every web designer knows, presentation is important; if your website doesn’t look professional, you’ll have trouble attracting users. However, structure is just as important, and if structural elements define the presentation, you’re probably creating unnecessary problems for your users.
For example, when creating content in Wordpress, many designers choose subheadings based on the appearance of those subheadings in the Wordpress content management system (CMS). If you’re editing your content within the CMS, an <h3> tag might look less obtrusive than an <h2>, so naturally, you select the more visually appealing option.
Generally, this is bad practice. Using an <h3> tag instead of an <h2> tag can cause issues for people who use screen readers — many AT users expect subheadings to appear in sequential order, and when this isn’t the case, they may assume that they’re missing content.
Another important consideration: Many users override the default CSS settings. For instance, if a person has low vision, they may set their browser to display normal text with a larger font size. If a person has color vision deficiencies (also called color blindness), they may override the default webpage colors to make sure that they can read the content comfortably.
If your website uses HTML to define semantics, these users will enjoy a better experience — but if you’ve used HTML to change presentation, your content may behave unpredictably.
Related: Plain Old Semantic HTML: A Perfect Basis for Accessibility
Creative use of CSS can correct many common barriers. Assistive technologies will generally respect HTML semantics, even when CSS delivers semantic definitions for certain elements. However, CSS can cause issues when used incorrectly.
Some quick tips to keep in mind:
Finally, if you must use CSS to control content in a way that changes its meaning (such as reordering content or generating new content via CSS), provide an accessible alternative. About 1 in 5 U.S. adults have at least one disability, and accommodating these users is in your best interest. Add a prominent link to an accessible version of the webpage.
To learn more about the best practices of accessibility, contact our subject matter experts or download the Essential Guide to ADA Compliance for Websites eBook.