Why does <main> not define the scope of <header> and <footer>?

55 views Asked by At

While going through the HTML standard's definition for sectioning content, it says that such elements define the scope of <header> and <footer> and that they can only be <article>, <aside>, <nav> and <section>.

Now, this means that if we put <header> and/or <footer> inside <main>, they won't be scoped to that <main> element.

My question is: why is this so? Why can't <main> also be considered as a sectioning content element?

Doesn't it make sense to be putting <header> and <footer> inside a <main> element.

1

There are 1 answers

1
Sean On

The usage notes for the <main> element state:

<main> doesn't contribute to the document's outline; that is, unlike elements such as <body>, headings such as h2, and such, <main> doesn't affect the DOM's concept of the structure of the page. It's strictly informative.

The <main> element isn't intended to be structural, and doesn't contribute to the document outline. It's solely and strictly meant to demarcate the dominant content within a document. So it makes sense that it doesn't act as sectioning content.