tags:

views:

26

answers:

1

In HTML5, some elements (e.g. <section>, <article>) create a new sectioning context in the document‘s outline, as per the outlining algorithm.

This basically means you can use <h1> as the top-level heading inside them without screwing up the document’s generated outline.

Does the <form> element create a sectioning context?

A: 

No, because it’s not sectioning content. Only the following elements are sectioning content:

  • <article>
  • <aside>
  • <nav>
  • <section>

However, the <fieldset> element is a sectioning root. This means that it creates a new sectioning context (like a sectioning content element), but headings and sections within it don’t contribute to the outlines of their ancestors.

So you can blindly use <h1> inside a <fieldset> element without screwing up your document’s outline.

Sectioning roots are:

  • <blockquote>
  • <body>
  • <details>
  • <fieldset>
  • <figure>
  • <td>

See http://dev.w3.org/html5/spec/Overview.html#headings-and-sections for a full description and examples.

Paul D. Waite