Better HN
topnewbestaskshowjobs
Log inSign up

noiiyfdedvv

11 karma · joined Mar 22, 2024 (2y ago) · 3 submissions

Submissions

comment 2y ago · link · parent

Good point. Apparently (MDN) there should only be 1 main on a page, and it should not include sidebars, generic headers/footers repeated on other pages, etc.

So, you might have a site-wide header, a main containing a content-specific header / content / footer, and then a site-wide footer.

Not sure how useful that would be, but interesting to me as a sometime web hacker.

comment 2y ago · link · parent

I was curious so I checked. According to MDN:

> Permitted parents: Any element that accepts flow content. Note that a <header> element must not be a descendant of an <address>, <footer> or another <header> element

I think you can use a header more or less anywhere, and it is a header for content contained by its parent.

comment 2y ago · link · parent

There’s a little typo in the simple example:

    <main>
      <header> </header>
      <section> </section>
      <section> </section>
      <section> </section>
      <footer> </footer>
    </header>
Note closing header not main.