Skip to main content
HTML Validation

The “main” role is unnecessary for element “main”.

About This HTML Issue

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>

Last reviewed: October 27, 2022

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.