Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's for a header, not a heading. A heading is a line of text providing a title for a section. A header is a part of the top of a page.


it's valid to put a <header> in any new section/main/article/aside


So it seems, my definition wasn't the best.


> A heading is a line of text providing a title for a section.

Which is exactly what <header> is trying to be.

> …introductory content for its nearest ancestor sectioning content or sectioning root element. A header typically contains a group of introductory or navigational aids.

> When the nearest ancestor sectioning content or sectioning root element is the body element, then it applies to the whole page.

Source: http://html5doctor.com/the-header-element/ (quoted from the actual spec)


> > A heading is a line of text providing a title for a section.

> Which is exactly what <header> is trying to be.

Not at all:

> > A header typically contains a group of introductory or navigational aids.

Key word here is group. A header is a block containing other elements. A heading is a line of text. Often the header contains a heading, but header element itself is not a heading.

A realistic example might be something like:

  <header>
     <h1>New York Times</h1>
     <time>Monday, February 20, 2017</time>
  </header>


your source clearly shows that it is not just for the heading (but can contain it, with <hX> tags), but contains other elements as well.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: