Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

nav — navigation section

The nav element identifies a major navigation block linking to other pages or locations within the current page.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<nav>…</nav>

nav identifies a navigation section, such as a site menu or table of contents. Not every link group needs nav; a short collection in footer usually does not.

Its content model allows flow content, not just a list. The element is sectioning content and supports global attributes. Neither its opening nor its closing tag may be omitted.

A document may contain multiple nav elements. Assistive technologies can use them to make navigation available or skip it.

Examples

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Page navigation</title>
</head>
<body>
  <h1>Guide</h1>
  <nav>
    <h2>Contents</h2>
    <ul>
      <li><a href="#intro">Introduction</a></li>
      <li><a href="#practice">Practice</a></li>
    </ul>
  </nav>
  <main>
    <h2 id="intro">Introduction</h2>
    <p>Start here.</p>
    <h2 id="practice">Practice</h2>
    <p>Try it yourself.</p>
  </main>
</body>
</html>

Result

Guide
Contents
• Introduction
• Practice
Introduction
Start here.
Practice
Try it yourself.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources