bootstrap navbar template code example

Example 1: bootstrap4 navbar

<nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">Navbar</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav">
      <li class="nav-item active">
        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Features</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Pricing</a>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>
    </ul>
  </div>
</nav>

Example 2: navbar in bootstrap4

<div class="pos-f-t">
  <div class="collapse" id="navbarToggleExternalContent">
    <div class="bg-dark p-4">
      <h4 class="text-white">Collapsed content</h4>
      <span class="text-muted">Toggleable via the navbar brand.</span>
    </div>
  </div>
  <nav class="navbar navbar-dark bg-dark">
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
  </nav>
</div>

Example 3: navbar examples

<nav class="navbar navbar-expand-md bg-dark 
  navbar-dark">
  <!-- Brand -->
  <a class="navbar-brand" href="#">Navbar</a>

  
  <!-- Toggler/collapsibe Button -->
  <button 
  class="navbar-toggler" type="button" 
  data-toggle="collapse" data-target="#collapsibleNavbar">
    
  <span class="navbar-toggler-icon"></span>
  </button>

  
  <!-- Navbar links -->
  <div class="collapse navbar-collapse" 
  id="collapsibleNavbar">
    <ul class="navbar-nav">
      
  <li class="nav-item">
        <a class="nav-link" 
  href="#">Link</a>
      </li>
      
  <li class="nav-item">
        <a class="nav-link" 
  href="#">Link</a>
      </li>
      
  <li class="nav-item">
        <a class="nav-link" 
  href="#">Link</a>
      </li> 
    
  </ul>
  </div> 
</nav>