# `<nav>`

> The `<nav>` HTML element represents a section of navigation links that typically guide users to other pages or sections within the web page or site.

## How do I use the `<nav>` element accessibly?

The element that defines a block of navigation links, such as a menu or table of contents. It helps users navigate through different sections of the webpage or website.

- Topic: Semantics
- Type: tag
- Browser support: Chrome 5+, Chrome Android 18+, Edge 12+, Firefox 4+, Firefox Android 4+, Safari 5+, Safari iOS 4.2+

## Example

Wrong:

```html
<nav>
  <a class="active" href="/">Home</a>
  <a href="/docs">Docs</a>
</nav>
```

Right:

```html
<nav aria-label="Main">
  <a aria-current="page" href="/">Home</a>
  <a href="/docs">Docs</a>
</nav>
```

The label names the landmark, and `aria-current` tells screen readers which page is active.

## Common mistakes

- Wrapping every group of links, like footer legal links, in `<nav>`.
- Having two unlabeled `<nav>` elements that screen readers cannot tell apart.

## Key points

- Each `<nav>` on a page has a distinct `aria-label`, like 'Main' or 'Breadcrumb'.
- The link to the current page has `aria-current="page"`.
- Navigation items are real `<a href>` links, often inside a `<ul>`.

## Interview questions

### Should links inside `<nav>` be in a list?

A `<ul>` is common and lets screen readers announce the number of links, but it is not required.

### Can I have more than one `<nav>` on a page?

Yes. Give each one a unique `aria-label` so users can tell them apart.

## Related cards

- [navigation](https://wonderium.dev/a11y/navigation.md)
- [\[aria-current\]](https://wonderium.dev/a11y/aria-current.md)
- [`<a>`](https://wonderium.dev/html/a.md)
- [`<header>`](https://wonderium.dev/html/header.md)
- [Skip Link](https://wonderium.dev/a11y/skip-link.md)

---

- Level: [HTML](https://wonderium.dev/html.md)
- HTML version: https://wonderium.dev/html/nav
- Last updated: 2026-11-25
