About Lesson
Introduction to Bootstrap 5 Navbar
- .navbar → Creates a responsive navbar
- .navbar-brand → Defines the brand/logo
- .navbar-nav → Groups navigation links
- .nav-item → Defines a menu item
- .nav-link → Defines a clickable link
Example: Basic Navbar
HTML
<nav class="navbar bg-light">
<div class="container">
<a class="navbar-brand" href="#">My Website</a>
<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="#">About</a></li>
</ul>
</div>
</nav>
Output:

Explanation:
- .navbar creates a horizontal navigation bar.
- .navbar-brand is used for the logo or site name.