HTML Checking for Large Sites
Rocket Validator automatically checks your pages on the W3C Validator.
HTML issues tagged as main.
There can only be one visible <main>
element in a document. If more are needed (for example for switching between them with JavaScript), only one can be visible, the others should be hidden toggling the hidden
attribute.
Example of 2 main
elements, where only one is visible:
<main>
<h1>Active main element</h1>
<!-- content -->
</main>
<main hidden>
<h1>Hidden main element</h1>
<!-- content -->
</main>
Learn more:
The main
landmark role is used to indicate the primary content of a document. It can be added to an element by using role="main"
, but instead it’s preferable to just use the <main>
element. In that case, it’s unnecessary to make the main role explicit. Examples:
<div role="main">
<!-- this is a valid way to define a main role -->
</div>
<main>
<!-- but this is shorter and uses correct semantic HTML -->
</main>
Read more:
Still checking your large sites one page at a time?
Save time using our automated web checker. Let our crawler check your web pages on the W3C Validator.