Description

The <nav> element defines a section of navigation links (i.e. links to other pages or to parts within the page itself) in a document.

The following table summarizes the usages context and the version history of this tag.

Placement:Block
Content:Block, inline, and text
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 5

Syntax

The basic syntax of the <nav> tag is given with:

HTML/XHTML: <nav> ... </nav>

The example below shows the <div> tag in action.

    <nav>
        <ul>
            <li><a href="https://www.tutorialrepublic.com">Home</a></li>
            <li><a href="https://www.tutorialrepublic.com/about-us.php">About</a></li>
            <li><a href="https://www.tutorialrepublic.com/contact-us.php">Contact</a></li>
        </ul>
    </nav>                         

Tip: It is not necessary to place all the links within a <nav> element. It is intended for major block of navigation links. The <nav> element is typically a replacement for the <div class="nav"> statement, frequently used in HTML.

Tag-Specific Attributes

The <nav> tag doesn't have any specific attribute.

Global Attributes

Like all other HTML tags, the <nav> tag supports the global attributes in HTML5.

Event Attributes

The <nav> tag also supports the event attributes in HTML5.

Browser Compatibility

Element
<nav>YesYesYesYesYes