XML technologies / CSS / Advanced websites with CSS / A three-column layout / The content order problem

The floating-sidebar layout looks great, but absolute positioning has an advantage: source column order does not matter. This matters for users without CSS or using screen readers. With floats, they must pass all sidebar content before reaching the main content at the end of the HTML.

Disable the stylesheet to see source order. Comment out its link and refresh: much clutter precedes the main content, partly shown below. Hearing the same sidebars on every page would be exhausting for screen-reader users.

The unstyled page

Figure: The unstyled page.

A skip-navigation link bypasses repeated or unimportant areas. Implement it by linking to an id at the main content’s start.

Add another link to the header navigation list:

<ul>
  <li><a href="">Contact Us</a> | </li>
  <li><a href="">About Us</a> | </li>
  <li><a href="">Privacy Policy</a> | </li>
  <li><a href="">Sitemap</a> | </li>
  <li><a href="#content">Jump to content</a></li>
</ul>

Load the page and click it: the viewport jumps down to place the element div with ID #content as high as possible, as shown below.

One click to the main information

Figure: One click to the main information.

Since these links offer little to other visitors, methods hide them except from text browsers and screen readers. Some screen readers, however, interpret CSS and JavaScript in ways that cause problems. For best accessibility, keep links visible near the top. Some owners, such as Molly Holzschlag, partly hide them. On Molly’s site, the link appears only when the pointer passes over the very top, as below.

The main-content link at molly.com

Figure: The main-content link at molly.com.

Other layout methods

Other multicolumn layouts with footers allow better source order, usually with compromises elsewhere. The “Source Ordered Columns” example on Position is Everything is one: every column must have fluid percentage widths rather than fixed pixels.

“Source Ordered Columns” at Position is Everything

Figure: “Source Ordered Columns” at Position is Everything.

Position is Everything offers excellent CSS demonstrations and ideas. Its article “In Search of the One True Layout” demonstrates three columns and a footer with the desired features, using complex techniques and many browser hacks. As CSS becomes familiar, these examples can be invaluable for problems, and fun to experiment with when time permits.

  

 

 

 

back to top