According to W3C specs about headers:

A header element is intended to usually contain the section’s heading (an h1–h6 element), but this is not required. The header element can also be used to wrap a section’s table of contents, a search form, or any relevant logos.

But I'm not sure about the word "contain". Does heading have to be the child of or is it also ok to have it inside header with some levels of nesting?

In other words, is this

<header>
  <div>
    <h3>Title</h3>
  </div>
  <p>Lorem</p>
</header>

as valid as this?

<header>
  <h3>Title</h3>
  <p>Lorem</p>
</header>

0 Answers