Heading for Trouble | July 20, 2004
There is an interesting discussion going on over at Jogin.com about the correct use of headlines. I’ve always seen headings as an indication of importance. If you look at this site you’ll see that the main headline for each post is a <h1> and any sub heads are <h2>’s. If you look at the side bar, all the headlines there are <h2>’s as well.
However Thomas points out that if you run such a site through the W3C validator with outline mode checked, you get an interesting result. Outline mode seems to be similar to documents outlines in Word which � if you’re lucky enough never to have used Word � provides you with a structural outline of your document. Looking at the outline of my homepage you’ll see that items in my side bar are being shown as structurally subordinate to the last post on my homepage. This obviously isn’t the case.
So it seems like headings are more to do with structure than importance. If you look at the specs they say
There are six levels of headings from H1 (the most important) to H6 (the least important).
Fair enough. This is probably why I, and many other web designers, have always seen heading levels being related to importance rather than structure. However you’d have thought that this being in the “structure” section of the specs would have been the first clue. The second clue for me is this line.
Heading information may be used by user agents, for example, to construct a table of contents for a document automatically.
Thinking about it logically, the only way a user agent would be able to do this is if � like the validator outline display � the user agent used the heading levels to extract structural meaning from the document.
So rather than my document structure looking like this:
<h1>Article Headline</h1>
<h2>Article Subhead</h2>
<h2>Article Subhead</h2>
<h2>Sidebar Headline</h2>
<h2>Sidebar Headline</h2>
It should look like this:
<h1>Article Headline</h1>
<h2>Article Subhead</h2>
<h2>Article Subhead</h2>
<h1>Sidebar Headline</h1>
<h2>Sidebar Subhead</h2>
<h2>Sidebar Subhead</h2>
The thing is, you may not always want to display a main sidebar headline. This is another reason why people have chosen to use headlines to denote importance rather than structure. However following the whole “markup first, style later” philosophy, it would seem logical to create the correct page structure and then use CSS to hide any elements that you don’t want to visually display.
What do you think?
Posted at July 20, 2004 9:20 AM
Nicolas Hoizey said on July 20, 2004 11:51 AM
I really think it’s important to use headings for document structure.
I, for example, use one single h1 for my website identity, one single h2 for the “page” identity (title of the article when accurate), and some h3 for sub headings.
Look the source : http://www.gasteroprod.com/2004/04/21/gastero_prod_4_standards_accessibilite_364.html
I try also to avoid headings in navigational contents.