HTML reference

nav

The <nav> element marks a major group of navigation links. It gives users and assistive technology a landmark they can find and skip to.

What you will learn

  • What navigation belongs in nav
  • How to label multiple navigation regions
  • When a group of links does not need nav

Basic example

<nav aria-label="Primary">
  <ul>
    <li><a href="/">Home</a></li>
    <li><a href="/guides">Guides</a></li>
  </ul>
</nav>

The links should form a meaningful navigation group. The label helps distinguish this region from another navigation, such as a table of contents or footer links.

Do not wrap every link

A single related link or a random list of links does not automatically become navigation. Use nav for major navigation blocks, and use an ordinary list or paragraph for smaller link groups.

Accessibility tips

Related pages