W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2009

[whatwg] Question on (new) header and hgroup

From: Thomas Broyer <t.broyer@gmail.com>
Date: Thu, 7 May 2009 17:34:08 +0200
Message-ID: <a9699fd20905070834i279ac9c0na49473fa276308c2@mail.gmail.com>
On Thu, May 7, 2009 at 5:15 PM, Bruce Lawson <brucel at opera.com> wrote:
> I'm struggling to understand the reasons for <hgroup>: wouldn't one or
> more h1..h6 elements wrapped in the same <header> imply just such a
> grouping without the need for such an element?

No longer, as <header> is not a sectioning element (IIUC).

> To illustrate my query, what is the difference between
> <header>
> <h1>HTML 5</h1>
> <h2>a new era of loveliness</h2>
> <nav> ... </nav>
> </header>
> and
> <header>
> <hgroup>
> <h1>HTML 5</h1>
> <h2>a new era of loveliness</h2>
> </hgroup>
> <nav> ... </nav>
> </header>
> ?

The answer is in the second example of <header> (copied thereafter for


In this example, the page has a page heading given by the h1 element,
and two subsections whose headings are given by h2 elements. The
content after the header element is still part of the last subsection
started in the header element, because the header element doesn't take
part in the outline algorithm.

  <h1>Little Green Guys With Guns</h1>
    <li><a href="/games">Games</a> |
    <li><a href="/forum">Forum</a> |
    <li><a href="/download">Download</a>
  <h2>Important News</h2> <!-- this starts a second subsection -->
  <!-- this is part of the subsection entitled "Important News" -->
  <p>To play today's games you will need to update your client.</p>
  <h2>Games</h2> <!-- this starts a third subsection -->
 <p>You have three active games:</p>
 <!-- this is still part of the subsection entitled "Games" -->

Thomas Broyer
Received on Thursday, 7 May 2009 08:34:08 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:12 UTC