<nav>
A block of main navigation: the site menu, a table of contents, breadcrumbs.
Syntax
<nav><a href="/">Home</a></nav>Attributes
| Parameter | Type | Description |
|---|---|---|
| aria-label | text | Optional. The name of the menu when the page has several. |
Examples
A menu made of a list of links:
<style>
nav ul { list-style: none; padding: 0; display: flex; gap: 16px; }
</style>
<nav aria-label="Main">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Menu</a></li>
<li><a href="#">Contacts</a></li>
</ul>
</nav>Notes
Wrap only major navigation blocks in <nav>, not every group of links. Screen readers let users jump straight to navigation, so when there are several menus, name them with aria-label.
See also
Related recipes
In the tutorial
- Semantic markup — The neutral div and span and the meaningful header, nav, main, article, section, aside and footer tags for page structure.