structure

<main>

Contains the dominant content of the document's <body> — the content unique to this page, excluding site-wide headers, nav, sidebars, and footers. Use exactly one visible <main> per page.

<main>...</main>

Common attributes

Attribute Purpose
id Target for skip-to-content links
class Styling hook
role ARIA override; role="main" is implicit

Examples

<main id="content">...</main>

Standard page main with skip-link target

<a href="#content">Skip to main</a>...<main id="content">...</main>

Accessibility skip link pairing

<body><header>...</header><main>...</main><footer>...</footer></body>

Typical landmark layout

Gotcha

A page must have only one

that isn't hidden — extras confuse assistive tech.
cannot be a descendant of
,

Related tags

← All HTML tags · CSS selectors · HTML entities