Recall & Review
beginner
What is the purpose of a responsive navbar collapse in Bootstrap?
It makes the navigation menu adapt to different screen sizes by hiding menu items behind a toggle button on small screens, improving usability on mobile devices.
Click to reveal answer
beginner
Which Bootstrap class is used to create the toggle button that shows or hides the collapsed navbar content?The <code>navbar-toggler</code> class is used on a <button> element to create the toggle button for collapsing and expanding the navbar content.Click to reveal answer
intermediate
What attribute connects the toggle button to the collapsible navbar content in Bootstrap?
The
data-bs-target attribute on the toggle button points to the ID of the collapsible navbar content, linking them for toggle functionality.Click to reveal answer
intermediate
How does Bootstrap decide when to collapse the navbar?
Bootstrap uses responsive breakpoint classes like
navbar-expand-lg to determine at which screen width the navbar should expand or collapse automatically.Click to reveal answer
intermediate
Name one accessibility feature to include in a responsive navbar toggle button.
Use
aria-controls to link the button to the collapsible content, aria-expanded to indicate toggle state, and aria-label to describe the button purpose for screen readers.Click to reveal answer
Which Bootstrap class makes the navbar expand only on large screens and collapse on smaller ones?
✗ Incorrect
The class
navbar-expand-lg tells Bootstrap to keep the navbar expanded on large screens and collapse it on smaller screens.What HTML element is typically used for the navbar toggle button?
✗ Incorrect
A
button element is used for the toggle because it is accessible and supports keyboard interaction.Which attribute on the toggle button specifies the ID of the collapsible navbar content?
✗ Incorrect
The
data-bs-target attribute points to the ID of the collapsible content to toggle it.What role does the
navbar-collapse class play in a Bootstrap navbar?✗ Incorrect
The
navbar-collapse class is used on the div that contains the menu items that collapse or expand.Which ARIA attribute indicates if the navbar toggle button is expanded or collapsed?
✗ Incorrect
aria-expanded tells screen readers whether the toggle button controls an expanded or collapsed menu.Explain how to create a responsive navbar that collapses on small screens using Bootstrap.
Think about the classes and attributes Bootstrap requires for toggle functionality.
You got /5 concepts.
Describe why responsive navbar collapse improves user experience on mobile devices.
Consider how navigation looks and works on phones versus desktops.
You got /5 concepts.