Bootstrap Navbar
Bootstrap provide responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.
Bootstrap Navbar Example
-
Documentation URL : https://getbootstrap.com/docs/5.3/components/navbar/
-
Code Snippet :
<nav class="navbar navbar-expand-lg bg-body-secondary">
<div class="container-fluid">
<a class="navbar-brand" href="#">
HMTMCSE Foundation
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navigation-area">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navigation-area">
<ul class="navbar-nav ms-auto mb-2 mb-lg-0">
<li class="nav-item"><a class="nav-link active" href="#">Home</a></li>
<li class="nav-item"><a class="nav-link" href="#">About</a></li>
<li class="nav-item"><a class="nav-link" href="#">Contact</a></li>
</ul>
</div>
</div>
</nav>
-
Here
-
.navbar-brand : Use for company, product, or project name.
-
.navbar-nav : A full-height and lightweight navigation
-
.navbar-toggler : Use with collapse plugin and other navigation toggling behaviors.
-
.collapse .navbar-collapse : Grouping and hiding navbar contents by a parent breakpoint.
-
data-bs-toggle="collapse" : Use for responsive navigation
-
-
Output :
Bootstrap Navbar with image and text
-
Documentation URL : https://getbootstrap.com/docs/5.3/components/navbar/#image-and-text
-
Code Snippet :
<nav class="navbar bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="https://www.hmtmcse.com/template-assets/img/logo-black.png" alt="Logo" width="80" height="30">
Name of the company
</a>
</div>
</nav>
-
Output :