Complete the code to create a basic Bootstrap navbar container.
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <div class="[1]"> Navbar content </div> </nav>
The container-fluid class creates a full-width container that spans the entire width of the viewport, which is common for navbars.
Complete the code to add a toggle button for collapsing the navbar on small screens.
<button class="navbar-toggler" type="button" data-bs-toggle="[1]" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>
The toggle button uses data-bs-toggle="collapse" to show or hide the navbar content on small screens.
Fix the error in the navbar brand link to correctly link to the homepage.
<a class="navbar-brand" href="[1]">MySite</a>
The homepage link should be / to point to the root of the website.
Fill both blanks to create a navbar list with two links: Home and About.
<ul class="navbar-nav me-auto mb-2 mb-lg-0"> <li class="nav-item"> <a class="nav-link active" aria-current="page" href="[1]">Home</a> </li> <li class="nav-item"> <a class="nav-link" href="[2]">About</a> </li> </ul>
The Home link should point to / and About to /about for proper navigation.
Fill all three blanks to create a responsive navbar that collapses on small screens with a brand and a toggle button.
<nav class="navbar navbar-expand-lg navbar-[1] bg-[2]"> <div class="[3]"> <a class="navbar-brand" href="/">Brand</a> <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-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"> <!-- Navbar links go here --> </div> </div> </nav>
The navbar uses navbar-dark for light text styling, bg-dark for dark background, and container-fluid for full width container.