W3cubDocs

/HTML

<nav>

The <nav> represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents. Common examples of navigation sections are menus, tables of contents, and indexes.

Content categories Flow content, sectioning content, palpable content.
Permitted content Flow content.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parents Any element that accepts flow content.
Permitted ARIA roles None
DOM interface HTMLElement

Attributes

This element only includes the global attributes.

Usage notes

  • Not all links of a document must be in a <nav> element, which is intended only for major block of navigation links; typically the <footer> element often has a list of links that don't need to be in a <nav> element.
  • A document may have several <nav> elements, for example, one for site navigation and one for intra-page navigation.
  • User agents, such as screen readers targeting disabled users, can use this element to determine whether to omit the initial rendering of this content.

Examples

In this example, a <nav> block is used to contain an unordered list (<ul>) of links. With appropriate CSS, this can be presented as a sidebar, navigation bar, or drop-down menu.

<nav class="menu">
  <ul>
    <li><a href="#">Home</a></li>
    <li><a href="#">About</a></li>
    <li><a href="#">Contact</a></li>
  </ul>
</nav>

Specifications

Specification Status Comment
HTML Living Standard
The definition of '<nav>' in that specification.
Living Standard No change since latest W3C snapshot.
HTML5
The definition of '<nav>' in that specification.
Recommendation Initial definition

Browser compatibility

Feature Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 5 Yes 4 9 11.1 4.1
Feature Android webview Chrome for Android Edge mobile Firefox for Android IE mobile Opera Android iOS Safari
Basic support Yes Yes Yes 4 9 11 4.2

See also

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/nav