The <nav> tag is used to define a section of navigation links. It is a semantic HTML5 element that helps search engines and screen readers identify navigation menus on a web page.
Using <nav> makes your website more structured, accessible, and SEO-friendly. It should contain only major navigation links (not all links on the page).
<nav> <a href="home.html">Home</a> <a href="about.html">About</a> <a href="services.html">Services</a> <a href="contact.html">Contact</a> </nav>
<!DOCTYPE html>
<html>
<head>
<title>Navigation Example</title>
</head>
<body>
<nav>
<a href="index.html">Home</a> |
<a href="blog.html">Blog</a> |
<a href="projects.html">Projects</a> |
<a href="contact.html">Contact</a>
</nav>
<h1>Welcome to My Website</h1>
</body>
</html>
<nav> for major site navigation only<nav>The <nav> tag defines a navigation section in HTML. It's a key element for building organized and accessible websites.
Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!