Skip to content

Nav

Semantic reference for <nav>.


Usage

html
<nav aria-label="Primary navigation">
  <a href="/">Home</a>
  <a href="/about">About</a>
  <a href="/blog">Blog</a>
</nav>

The <nav> element represents a navigation section with links to other pages or sections within the page.

Accessibility

  • Creates a navigation landmark role automatically.
  • Use aria-label to distinguish multiple navs on the same page (e.g., "Primary navigation", "Footer navigation").