Coding the Bootstrap navigation

Now let's head to the navbar section of Components in our Bootstrap website. Here, you can find all the necessary documentation to build your navigation with Bootstrap. 

Now let's head back to our HTML file and write the following code:

<nav class="navbar navbar-expand-lg fixed-top "></nav>

The details of the preceding code are as follows:

  1. We start off within the body of the content by adding our <nav> element and all <nav> elements require a navbar class. 
  2. Then, we added the new expand class, which is the navbar-expand-lg. This essentially tells the browser when to collapse the navbar and when to expand it.
  3. So, in this case, it will expand and show the desktop version when it hits large screens. If we wanted ...

Get Practical Web Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.