HTML <nav> tag
- closing tag
- required
- void element
- no
- lives inside
- <body>, often inside or next to <header>
- typically holds
- a list of <a> links
Where it goes
Usually inside or right after <header>, near the top of <body>. Not every group of links needs <nav>. Save it for the real site menu or a section's menu.
Example
<nav>
<a href="/">Home</a>
<a href="/about">About</a>
</nav>Open this example in the editor →
Common mistakes
- Wrapping every link on the page in <nav>. It is for a menu, not for links in general.
- Forgetting that the links inside still need real href values to go anywhere.