Can a web page contain multiple header elements? What about footer elements?

Can a web page contain multiple header elements? What about footer elements?

W3 recommends having as many as you want, but only 1 of each for each “section” of your page, i.e. body, section etc.

Answer

Yes to both. The W3 documents state that the tags represent the header(<header>) and footer(<footer>) areas of their nearest ancestor “section”. So not only can the page <body> contain a header and a footer, but so can every <article> and <section> element.

W3 recommends having as many as you want, but only 1 of each for each “section” of your page, i.e. body, section etc.


© 2022. All rights reserved.