Skip to content

Try our new Crash Courses!

Buy one of our new Crash Courses, now hosted on Podia.

nav element – HTML

Demo

Summary

<nav>
  <ul>
    <li><a href="index.html">Home</a></li>
    <li><a href="about.html">About Us</a></li>
    <li><a href="contact.html">Contact Us</a></li>
  </ul>
</nav>

Details

The nav element is used to wrap around navigation links, like in the example above.

A common use for the nav element is the navigation menu at the top of a web page. Another use case could be a table of contents for a long blog post.

A web page can have more than one nav element.

Exercises

Recreate the embedded CodePen demo by typing out the HTML code in your index.html file.

References

The Navigation Section element on MDN

Lesson tags: Open Lesson
Back to: HTML Reference > HTML Body Elements