[html5] <header>, <hgroup> and subheadings

Micky Hulse mickyhulse.lists at gmail.com
Wed May 1 18:00:26 PDT 2013


Check out this scenario:

Not using an <hgroup>:

<doctype html>
<title>Hello, world!</title>
<h1>This is a section</h1>
<article>
   <heading>
       <h3>Tertiary heading</h3>
       <h1>Primary heading</h1>
       <h2>Secondary heading</h2>
   </heading>
</article>

Outline:

1. This is a section
   1. Tertiary heading
   2. Primary heading
       1. Secondary heading

Now, using an <hgroup>:

<doctype html>
<title>Hello, world!</title>
<h1>This is a section</h1>
<article>
    <heading>
        <hgroup>
            <h3>Tertiary heading</h3>
            <h1>Primary heading</h1>
            <h2>Secondary heading</h2>
        </hgroup>
    </heading>
</article>

Outline:

1. This is a section
   1. Primary heading

Clearly, in this case, the <hgroup> proves to be useful as it allows
for non-sequential heading orders and it pulls the <h1> as the title
for group in the outliner.

I'd hate to always have to have <h1> come first ... Sometimes one
needs to put a less important heading above the most important heading
(I'd say that's a pretty common pattern that people use for when it
comes to multiple headings).

Anyone following me here? :D



More information about the Help mailing list