HTML reference
main
The <main> element identifies the primary content of a document. It helps people using assistive technology jump past repeated navigation and site chrome.
What you will learn
- What content belongs in
main - How landmarks support skip navigation
- How
header,nav, andasidediffer
Basic structure
<header>Site header</header>
<nav aria-label="Primary">...</nav>
<main id="main-content">
<h1>Article title</h1>
<p>Primary content</p>
</main>
<footer>Site footer</footer>One primary main
A document should normally have one visible main element containing the page-specific content. Do not put repeated site navigation, sidebars, or unrelated advertisements inside it just because they appear near the center visually.
Accessibility tips
- Make the main region easy to reach with a skip link.
- Start it with a clear heading.
- Do not hide the primary content from assistive technology.
- Use
sectionandarticleinside it when those semantics fit.