Challenge - 5 Problems
Bootstrap List Group Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual output of this Bootstrap list group code?
Look at the following HTML code using Bootstrap classes. What will you see rendered in the browser?
Bootsrap
<ul class="list-group"> <li class="list-group-item">First item</li> <li class="list-group-item active">Second item</li> <li class="list-group-item">Third item</li> </ul>
Attempts:
2 left
💡 Hint
Remember that the class 'active' in Bootstrap list groups highlights the item with a special background and text color.
✗ Incorrect
The 'list-group-item active' class combination applies a blue background and white text to highlight the active item in the vertical list.
❓ selector
intermediate1:30remaining
Which CSS selector targets only active items in a Bootstrap list group?
You want to style only the active items in a Bootstrap list group. Which CSS selector will select them correctly?
Attempts:
2 left
💡 Hint
Look for the class combination that matches both 'list-group-item' and 'active' on the same element.
✗ Incorrect
The selector '.list-group-item.active' selects elements with both classes 'list-group-item' and 'active'. Other options either use invalid class names or pseudo-classes.
❓ layout
advanced2:00remaining
How to make a Bootstrap list group horizontal on large screens only?
You want your Bootstrap list group to display horizontally only on large screens (≥992px) and vertically on smaller screens. Which class should you add?
Attempts:
2 left
💡 Hint
Bootstrap provides responsive horizontal list group classes with breakpoints like '-sm', '-md', '-lg'.
✗ Incorrect
The class 'list-group-horizontal-lg' makes the list group horizontal only on large screens and above, keeping it vertical on smaller screens.
❓ accessibility
advanced1:30remaining
Which ARIA role is best for a Bootstrap list group to improve accessibility?
To make a Bootstrap list group more accessible for screen readers, which ARIA role should you add to the
- element?
Attempts:
2 left
💡 Hint
A list group is a simple list, so use the ARIA role that matches a list structure.
✗ Incorrect
The role 'list' tells assistive technologies that the element is a list, improving semantic meaning without confusing it with menus or navigation.
🧠 Conceptual
expert2:30remaining
What happens if you nest a
Consider this code snippet:
- Item 2
Attempts:
2 left
💡 Hint
Think about HTML semantics and valid nesting rules for lists and buttons.
✗ Incorrect
While Bootstrap styles buttons with 'list-group-item' to look like list items, placing a