07 Oct Bootstrap Navbar
Learn how to create a Responsive Navigation Bar in Bootstrap. We will also implement the following to understand the Navbar concept on a web page completely:
- Center a Navigation Bar using the .navbar class
- Change the background color of the navigation bar
- Center a Navigation Bar using .justify-content-center class
- Change the text color of the nav bar items
- Set the logo on the top navigation bar using .navbar-brand class
- Set plain text using .navbar-text class
- Set fixed navigation bar (top): .fixed-top class.
- Set fixed navigation bar (bottom): .fixed-bottom class
Example – Bootstrap Navbar
Let us now see an example of creating a Navbar in Bootstrap:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Navbar Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<nav class="navbar">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Review</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</nav>
</body>
</html>
Output

Video Tutorial – Bootstrap Navbar
The following is the complete video tutorial to learn how to work with Navbar in Bootstrap:
If you liked the tutorial, spread the word and share the link and our website Studyopedia with others:
Read More:
No Comments