[html5] Can a <section> wrap more than one <h1>?

Ian Hickson ian at hixie.ch
Fri Mar 12 15:43:15 PST 2010


On Mon, 1 Mar 2010, Tae Sandoval Murgan wrote:
> 
> Far as I know, each <section> element generates a new branch in the 
> structure of the document, as is the case with the headers, so:
> 
> <section>
>     <h1></h1>
>     <section>
>             <h2></h2>
>     </section>
> </section>
> 
> gives the same result as:
> 
> <h1></h1>
> <h2></h2>
> 
> So I expect something like:
> 
> <section>
>     <h1></h1>
>     <h1></h1>
> </section>
> 
> is wrong, however, the validator (http://html5.validator.nu/) gives me
> no errors or warnings, and the outliner
> (http://gsnedders.html5.org/outliner/) gives me a structure alike:
> 
> <body>
>     <h1></h1>
>     <h1></h1>
> </body>
> 
> Is that OK? Can a section have more than one <h1> and so grouping
> related information?

If you have two <h1>s in the section, it's effectively two sections. A 
<section> scopes <hx>s like <body> does.

If you have a suggestion for an example to demonstrate this, and if you 
have a good suggestion of where I should put it (where did you look to try 
to understand this? That's probably the best place) I'd be happy to add 
one.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'



More information about the Help mailing list