Bootstrap
Navbar
Build a responsive collapsing navbar with brand and links.
By EZ4Code Team
navbarnavigation
Code
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top">
<div class="container-fluid">
<a class="navbar-brand" href="#">Brand</a>
<button class="navbar-toggler" type="button"
data-bs-toggle="collapse" data-bs-target="#nav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="nav">
<ul class="navbar-nav me-auto">
<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>
</ul>
<form class="d-flex">
<input class="form-control me-2" type="search" placeholder="Search">
<button class="btn btn-outline-light" type="submit">Go</button>
</form>
</div>
</div>
</nav>Explanation
The navbar collapses into a toggle button below the expand-lg breakpoint and shows full links above it. navbar-dark/bg-dark style text and background, sticky-top keeps it pinned on scroll. data-bs-toggle attributes wire up the collapse via Bootstrap's JS.
More Bootstrap Snippets
Grid System
Lay out pages with the 12-column responsive grid.
Responsive Utilities
Show, hide, and reorder elements per breakpoint.
Cards
Compose a card with image, body, list, and footer.
Modal
Trigger and structure a Bootstrap modal dialog.
Forms & Validation
Build a responsive form with validation feedback.
Buttons
Use button variants, sizes, states, and groups.