Complete the code to add a brand name inside the navbar.
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="navbar-brand" href="#">[1]</a> </nav>
The navbar-brand class is used to display the brand name or logo inside the navbar. Here, you fill the blank with the brand text.
Complete the code to add a button that toggles 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 data-bs-toggle attribute should be set to collapse to toggle the collapsible navbar content on small screens.
Fix the error in the button's aria-label attribute to improve accessibility.
<button class="navbar-toggler" type="button" aria-label="[1]"> <span class="navbar-toggler-icon"></span> </button>
The aria-label should clearly describe the button's action. 'Toggle navigation' is the standard label for navbar toggler buttons.
Fill both blanks to complete the navbar brand link and toggler button.
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="[1]" href="#">Brand</a> <button class="[2]" type="button" data-bs-toggle="collapse" data-bs-target="#navbarContent" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> </nav>
The brand link uses the class navbar-brand. The button that toggles the navbar uses the class navbar-toggler.
Fill all three blanks to complete the navbar with brand, toggler, and collapsible content.
<nav class="navbar navbar-expand-lg navbar-light bg-light"> <a class="[1]" href="#">MySite</a> <button class="[2]" type="button" data-bs-toggle="collapse" data-bs-target="#[3]" aria-controls="[3]" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <div class="collapse navbar-collapse" id="[3]"> <!-- Navbar content here --> </div> </nav>
The brand uses navbar-brand. The toggler button uses navbar-toggler. The collapsible content's ID and target is 'navbarSupportedContent'.