Positioning Navbar Content

We can use the positioning utilities available with Bootstrap to position our navbars.

  • .fixed-top to have position fixed at the top of the browser
  • .fixed-bottom to have position fixed at the bottom of the browser
  • .sticky-top to have the navbar scroll with the page and then stick to the top of the browser when it reaches the top
<!-- Example with sticky-top class-->
<nav class="navbar bg-dark navbar-dark navbar-expand-md sticky-top">
  <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>
    <li class="nav-item"><a class=" nav-link" href="#">Contact</a></li>
  </ul>
</nav>