How to create navigation bar using <div> tag in HTML ?
In this article, we will know to create the navigation bar using the <div> tag in HTML. The Navbar is a navigation header that contains the links to navigate to the different pages or sections of the site that helps to make the website interactive. The navbar is an important & fundamental component for any site format, as it represents the multiple data in an organized manner & allows to quickly access the most useful resources. The navbar can be implemented most commonly in the sidebar or header of the page or can be aligned either horizontally, vertically, fixed, or dynamic.
<div class="navbar"> <div class="brand"> <h3>GeeksforGeeks</h3> </div> <div class="menu"> <a href="#">Tutorials</a> <a href="#">Student</a> </div> </div>
Approach: We will create a div section & give a class name as navbar. Then we make two more div’s under the navbar-defined div, First child div is named brand class for logo, and the other child div defined menu for navigation. We have used the display flex property in the parent div navbar to align in inline. Then we make another parent div class that defines the body for more content.
Example: This example describes the navigation bar using HTML <div> tag.