Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5: Multiple footers/headers in a section

Tags:

html

I understand you can have multiple headers/footers in a page such as for the <article>s and another site wide header/footer for the <body> but I've not found anywhere stating that having multiple headers and or footers in a single section is acceptable.

<body>
<header class="header-group-1"></header>
<header class="header-group-2"></header>

<!-- other content -->

<footer class="footer-group-1></footer>
<footer class="footer-group-2></footer>
</body>
like image 612
Larry21 Avatar asked Oct 01 '22 15:10

Larry21


1 Answers

Multiple header elements are allowed, and each of them specifies “introductory content for its nearest ancestor sectioning content or sectioning root element”, i.e. the nearest enclosing article, aside, nav, section, blockquote, body, details, dialog, fieldset, figure, or td element. So you can have e.g.

<body>
<header>body header</header>
...
<article>
  <header>article header</header>
  ...
</article>

There is no prohibition against having e.g. two header elements (at the same level of nesting) in an article element. They would then both contain “introductory content” for it. It is however difficult to imagine situations where this would make sense, since header elements normally precede other content, and the header would thus be adjacent and could be combined into one.

like image 188
Jukka K. Korpela Avatar answered Oct 05 '22 12:10

Jukka K. Korpela