Bootstrap 5 NavbarsA navigation bar is a navigation header that is placed at the top of the page: Show Basic NavbarWith Bootstrap, a navigation bar can extend or collapse, depending on the screen size. A standard navigation bar is created with the To add links
inside the navbar, use either an
Example<!-- A grey horizontal navbar that becomes vertical on small screens --> <div
class="container-fluid"> </nav> Try it Yourself » Vertical NavbarRemove the
Example<!-- A grey vertical navbar --> Try it Yourself » Centered NavbarAdd the
Example<nav class="navbar navbar-expand-sm bg-light justify-content-center"> Try it Yourself » Colored Navbar
Use any of the Tip: Add a white text color to all
links in the navbar with the Example<!-- Grey with black text --> <!-- Black background with white text --> <!-- Blue background with white text --> Try it Yourself » Active/disabled state: Add the Brand / LogoThe Example<nav class="navbar
navbar-expand-sm bg-dark navbar-dark"> Try it Yourself » When using the
Example<nav class="navbar navbar-expand-sm bg-dark navbar-dark"> Try it Yourself » Navbar TextNavbar text Use the Example<nav class="navbar navbar-expand-sm bg-dark navbar-dark"> Try it Yourself » Very often, especially on small screens, you want to hide the navigation links and replace them with a button that should reveal them when clicked on. To create a collapsible navigation bar, use a button with Example<nav class="navbar navbar-expand-sm bg-dark navbar-dark"> Try it Yourself » Tip: You can also remove the Navbar With DropdownNavbars can also hold dropdown menus: Example<li class="nav-item dropdown"> Try it Yourself » Navbar Forms and ButtonsYou can also include forms inside the navigation bar: Example<nav class="navbar navbar-expand-sm navbar-dark bg-dark"> Try it Yourself » Fixed Navigation BarThe navigation bar can also be fixed at the top or at the bottom of the page. A fixed navigation bar stays visible in a fixed position (top or bottom) independent of the page scroll. The Example<nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top"> Try it Yourself » Use the Example<nav class="navbar navbar-expand-sm bg-dark
navbar-dark fixed-bottom"> Try it Yourself » Use the Example<nav class="navbar
navbar-expand-sm bg-dark navbar-dark sticky-top"> Try it Yourself » |