With the addition of the <main>
element in the HTML5 draft spec, which is the more correct page layout?
<body>
<header> ... </header>
<main>
<aside> ... </aside>
</main>
<footer> ... </footer>
</body>
or;
<body>
<header> ... </header>
<section>
<main> ... </main>
<aside> ... </aside>
</section>
<footer> ... </footer>
</body>
The answer as to the correctness of each of the example markup patterns can be found in the normative definition of the main element.
Contexts in which this element can be used: Where flow content is expected, but with no article, aside, footer, header or nav element ancestors. Authors must not include more than one main element in a document.
In this case either example markup is conforming. It is difficult to know which is the most appropriate or practical from a theoretical example alone.
And which spec are the browsers following?
Browsers have implemented the main element as defined in the W3C HTML specification. Conformance checkers such as the W3C HTML validator will implement the conformance requirements of the W3C HTML spec.
Note: The main element will be added to HTML 5.0 in the near future.
Note: The specification of the main element in HTML 5.1 supersedes the extension spec.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With