Learnerslesson
   JAVA   
  SPRING  
  SPRINGBOOT  
 HIBERNATE 
  HADOOP  
   HIVE   
   ALGORITHMS   
   PYTHON   
   GO   
   KOTLIN   
   C#   
   RUBY   
   C++   
   HTML   
   CSS   
   JAVA SCRIPT   
   JQUERY   




HTML - Nav Tag


The nav tag or <nav> tag in HTML is used to define a group of navigation menu in a webpage.


Why do we need Nav Tag in HTML?


The Nav Tag defines set of navigation links that can be placed inside the nav tag.


What does the Nav Tag contain?


The nav tag usually contains set of navigation links.


Let us understand nav tag with the below example.


Example :



<html>
<body>
	<nav>
  		<ul>
            <li><a href="#">Home</a></li>
            <li><a href="#">About Us</a></li>
            <li><a href="#">Contact Us</a></li>
        </ul>
	</nav>	
</body>
</html>


Output :




So, if you look at the above code. The nav tag contains navigation lists for an HTML page.


<nav>
	<ul>
		<li><a href="#">Home</a></li>
		<li><a href="#">About Us</a></li>
		<li><a href="#">Contact Us</a></li>
	</ul>
</nav>