main-require
A <main>
element is required within the <body>
tag of HTML documents. This rule ensures that the document has a clear and accessible structure, which is important for both users and screen readers.
Level: Warning
Config value
Section titled “Config value”- true: enable rule
- false: disable rule
The following patterns are not considered rule violations
Section titled “The following patterns are not considered rule violations”<html><body><main>Content</main></body></html>
<html><body><header>Header</header><main>Content</main><footer>Footer</footer></body></html>
The following patterns are considered rule violations
Section titled “The following patterns are considered rule violations”<html><body><p>No main tag</p></body></html>
<html><body><header>Header</header><footer>Footer</footer></body></html>