structure

<nav>

Marks a section of major navigation links, either within the site or the current page. Use for primary menus, breadcrumbs, and pagination — not for every group of links.

<nav aria-label="Main"><ul>...</ul></nav>

Common attributes

Attribute Purpose
aria-label Names the nav when multiple exist
aria-labelledby References a heading that names the nav
class Styling hook
id Anchor target or JS hook

Examples

<nav aria-label="Primary"><a href="/">Home</a><a href="/blog">Blog</a></nav>

Site-wide primary navigation

<nav aria-label="Breadcrumb"><ol><li><a href="/">Home</a></li><li>Docs</li></ol></nav>

Breadcrumb trail

<nav aria-label="Table of contents">...</nav>

In-page section navigation

Gotcha

Not every collection of links is a

Related tags

← All HTML tags · CSS selectors · HTML entities