Disallows multiple <main>
elements in the same document
- Rule ID:
- no-multiple-main
- Category:
- Content model
- Standards:
- HTML5
HTML5 disallows multiple visible <main>
element in the same document.
Multiple <main>
can be present but at most one can be visible and the others must be hidden using the hidden
attribute.
Rule details
Examples of incorrect code for this rule:
<main>foo</main>
<main>bar</main>
Examples of correct code for this rule:
<main>foo</main>
<main hidden>bar</main>