WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Heading order/nesting - was RE: H1 header in iframe

for

From: Jared Smith
Date: Aug 26, 2010 9:24AM


On Thu, Aug 26, 2010 at 8:30 AM, Susan Grossman wrote:
>> ...Interestingly, the new w3.org site uses two <h1>s on content page -
> one for the logo and one for the document heading.
>
> I was taught that you never use more than one H1 on a page, and have
> followed this, without question on all sites.

Well, the H1 is a first level, main document heading. The HTML spec
indicates that a heading "describes the topic of the section it
introduces" (http://www.w3.org/TR/html401/struct/global.html#h-7.5.5).
As such, making the site name the <h1> is perfectly valid. But if you
then use more than one <h2> (one being for the document title), you
are saying that the document title and the entirety of the main
content of that page are equal in importance to any other <h2>s (and
their content) on that page. Is the main subject of the page really
equal to the sidebar or footer or main navigation?

On the other hand, I think most web pages are about or described best
by the document title. With the exception of the home page, few
documents are really about or best described by "site name".

By using two <h1>s, you are essentially saying that the web page is
comprised of two distinct pieces or two distinct documents, perhaps.
Considering the structure of the W3.org site, the first part of the
page including the main navigation is described by the site name
("W3C"). But the second <h1> indicates that the main content and
beyond (including the footer navigation) is described by the document
title, but it is NOT described by or within "W3C" at all. This makes
no sense at all to me.

Now if your document truly is comprised of two distinct 'documents'
(an English version and a Spanish version, for example), then two
<h1>'s might be very appropriate.

> And since I was taught  there can't be an H2 without an H1

I hear this being taught, but don't see any strong reason why it must
be this way. The spec certainly does not require it. Maybe I'm missing
something.

> So is there an H1 rule or not?  Is anything cut and dry?

As with most things in HTML, the rules are made to be broken. The spec
does not clarify either way. There is and always will be debate about
this. http://h1debate.com/ gives much insight. It is worth noting that
70% of voters there believe the document title should be the <h1> as
opposed to the site name/logo. From an accessibility standpoint, I
think this practice provides great utility for keyboard users, is
structurally and semantically sound, and makes the most sense. It is
thus what I use and recommend.

Jared Smith