HTML5 Nav Tag for Navigation | Generated by AI

Home 2025.11

The correct HTML5 semantic tag for the main navigation area of a page (typically the primary menu with links to the main sections of the website) is <nav>.

Example usage:

<nav>
  <ul>
    <li><a href="/">Home</a></li>
    <li><a href="/about">About</a></li>
    <li><a href="/services">Services</a></li>
    <li><a href="/blog">Blog</a></li>
    <li><a href="/contact">Contact</a></li>
  </ul>
</nav>

Key points:

Optional accessibility improvement:

You can add aria-label or aria-labelledby to describe the purpose, especially if there are multiple <nav> elements:

<nav aria-label="Main navigation">
  <!-- links -->
</nav>

So, in short: <nav> is the proper semantic HTML5 tag for the main navigation area.


Back

x-ai/grok-4.1-fast

Donate