HTML <nav> tag

The <nav> tag is used to define a set of navigation links in a webpage. A page can have multiple <nav> elements in a page. (Example header menu and footer menu.)

Type: Block Element

Syntax of <nav> tag

<nav>
  Navigation links
</nav>

<main>..</main>

<footer>..</footer>

Full code example

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<header>..</header>

<nav>
  <a href="#">Home</a>
  <a href="#">Blog</a>
  <a href="#">About us</a>
</nav>

<main>..</main>

<footer>..</footer>

</body>
</html>
Run The code »
<nav> tag new in HTML5.

Supported Browsers

Tag Chrome Internet Explorer Firefox Safari Opera Mini
<nav> 6.0 or higher 9.0 or higher 4.0 or higher 5.0 or higher 11.1 or higher

More reference

<nav> element is used to define navigation links and menus only. Using this element for all links in a page is wrong in modern HTML structure.

Its primary uses is making primary navigation bar which is mostly located at the top of a page. This tag also helps in the screen readers to identify the primary navigation areas in the document.

Default CSS property of <nav> tag

nav {
  display: block;
}