Use cascading style sheets (CSS) to present page content

Using Cascading Style Sheets (CSS) allows developers to separate content from presentation. In other words, with CSS the visual layout of a Web page can be established with style sheets, while the content can be put into HTML. CSS gives developers the ability to change the linear layout of a page — the order of elements on a Web page when all styles and formatting are removed — without altering its visual layout. This is important because the linear reading order of Web content is the order in which screen readers access the content. Another advantage with CSS is that it gives the end user control over the Web page style as well. For example, the user can change the background color or increase the font.

There are general benefits to using CSS: Sites created with CSS are easier to maintain. A change to the site style sheet is applied across all pages in the site instantly. You will find that many of the formatting tags you may have used in HTML 4 (like <b> and <u>) have been deprecated in XHTML in favor of using styles. So, as time goes on, you will need to use styles to be able to create effective XHTML pages.

Please note, though, that the use of CSS does not in itself make a Web page accessible. The most critical consideration is the use of valid, semantic (X)HTML. In fact, any page that uses styles should be usable with the styles disabled.

Guidelines

  • Develop Web pages in valid, accessible (X)HTML first.
  • Then apply styles to achieve the desired visual presentation.