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:
- We start off within the body of the content by adding our <nav> element and all <nav> elements require a navbar class.
- 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.
- So, in this case, it will expand and show the desktop version when it hits large screens. If we wanted ...