Use semantic HTML
This semantic HTML contains all accessibility features by default.Skip to main content Not main content
About main content
The main content of the page belongs here.
When you can’t use semantic HTML
This custom main element requires extra attributes.
- Typically doesn’t have a name other than its role.
- Identifies itself as a main landmark
- If a non-semantic element must be used (like a
- must contain the main content of the page.
- Can be targeted with a skip link, but isn’t focusable with the tab key
tabindex="-1"to make the main targetable with a skip link.