nav – navigation
<nav aria-label="Main menu">…</nav>
A block of main navigation links: the website menu, breadcrumbs, the table of contents of a long page or pagination. Not every group of links is navigation – links to the terms and conditions in the footer usually do not need nav.
- Default display:
display: block - End tag: required
- Content: flow content (usually a list of links,
ulorol) - Where it can be used: anywhere flow content is allowed
- DOM interface:
HTMLElement
Attributes
Only global attributes. When a page has several navigations, name them with aria-label or aria-labelledby.
Examples
The main menu as a list of links – aria-current="page" marks the current page:
<nav aria-label="Main menu">
<ul>
<li><a href="/">Home</a></li>
<li><a href="/pastries/" aria-current="page">Pastries</a></li>
<li><a href="/contact/">Contact</a></li>
</ul>
</nav>
Breadcrumbs – a numbered list, because the order matters:
<nav aria-label="Breadcrumbs">
<ol>
<li><a href="/">Home</a></li>
<li><a href="/pastries/">Pastries</a></li>
<li><a href="/pastries/bread/" aria-current="page">Bread</a></li>
</ol>
</nav>
Accessibility
nav has the navigation role. Screen readers list the navigations of the page and the user can jump to them. Without names the list would just say “navigation” several times – hence aria-label. Do not put the word “navigation” in the name, the screen reader adds it itself (“Main menu, navigation”).
Things to watch out for
- Too many
navelements do not help orientation. Mark only the main navigation blocks. navon its own does not look any different – the look of the menu (bullets, horizontal layout) is up to CSS. A list inside is useful because the screen reader announces the number of items.- A drop-down menu on phones must also work with the keyboard; the control that opens it is a
buttonwitharia-expanded, not a link.
Browser support
Baseline – widely available: works in all major browsers and has for a long time (since 2015 at the latest). Since version: Chrome 5, Firefox 4, Safari 5. As of October 2026 (MDN browser-compat-data).
Related:
header – header
footer – footer
ul – bulleted list
ol – numbered list
a – link
aria-* – accessibility attributes