Skip to content

no-multiple-main

Reports a second <main> element that is not hidden.

A page has one main landmark; a second one makes the shortcut of a screen reader to the main content ambiguous.

To fix, use one <main>, or mark the other hidden.

Reported
...
<table><tbody><tr><td>a</td></tr></tbody></table>
<main></main>
<main hidden></main>
<main></main>
<p id="a"></p>
...
angular:
lint:
rules:
no-multiple-main: warn # off, warn (default), error
html:
lint:
rules:
no-multiple-main: warn # off, warn (default), error
svelte:
lint:
rules:
no-multiple-main: warn # off, warn (default), error
vue:
lint:
rules:
no-multiple-main: warn # off, warn (default), error

Enabled by the presets: html/html-validate-standard.

Suppress one line with sudsy-disable-next-line no-multiple-main in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
html-validate no-multiple-main full