Navbar

Bootstrap's navbar is a powerful, responsive component to provide sensible navigation around a website. Before getting into the details, let's add the navbar to the top of our page (right below the body tag) and see what happens:

<nav class="navbar navbar-expand navbar-light">   <a class="navbar-brand" href="#">MyPhoto</a>   <div class="collapse navbar-collapse">      <ul class="navbar-nav mr-auto">         <li class="nav-item">            <a class="nav-link" href="#welcome"> Welcome</a>         </li>         <li class="nav-item"><a class="nav-link"             href="#services"> Services</a></li>         <li class="nav-item"><a class="nav-link"             href="#gallery"> Gallery</a></li>         <li class="nav-item"><a class="nav-link"             href="#about"> About</a></li>         <li class="nav-item"><a class="nav-link"  href="#contact"> ...

Get Mastering Bootstrap 4 - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.