HTML Tag Reference - HTML tag <nav>








The <nav> element marks a navigation section.

Browser compatibility

<nav> Yes 9.0 Yes Yes Yes

What's new in HTML5

The <nav> tag is new in HTML5.

Global Attributes

The <nav> tag supports the Global Attributes in HTML.

Event Attributes

The <nav> tag supports the Event Attributes in HTML.

Default CSS Settings

nav {
    display: block;
}




Example

<!DOCTYPE HTML> 
<html> 
<body> 
    <header> 
        <nav> 
            <h1>H1</h1> 
            <ul> 
                <ul> 
                    <li><a href="#">A</a></li> 
                    <ul> 
                        <li><a href="#">B</a></li> 
                    </ul> 
                    <li><a href="#">C</a></li> 
                <ul> 
                    <li><a href="#">D</a></li>
                    <li><a href="#">E</a></li> 
                </ul> 
            </ul> 
        </nav> 
</header> <!--from  w  w  w .  j  av  a  2s. c om-->
</body> 
</html>

Click to view the demo