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:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
<!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