0
0
Bootsrapmarkup~20 mins

List group component in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bootstrap List Group Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2: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>
AA vertical list with three items; all items have the same background and no highlight.
BA horizontal list with three items; the second item is bold but no background color change.
CA vertical list with three items; the first item is highlighted with a green background.
DA vertical list with three items; the second item has a blue background and white text indicating it is active.
Attempts:
2 left
💡 Hint
Remember that the class 'active' in Bootstrap list groups highlights the item with a special background and text color.
selector
intermediate
1: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?
A.list-group > .active
B.list-group .active-item
C.list-group-item.active
D.list-group-item :active
Attempts:
2 left
💡 Hint
Look for the class combination that matches both 'list-group-item' and 'active' on the same element.
layout
advanced
2: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?
AAdd class 'list-group-horizontal' to the <ul> element.
BAdd class 'list-group-horizontal-lg' to the <ul> element.
CAdd class 'd-flex flex-row' to the <ul> element.
DAdd class 'list-group-horizontal-md' to the <ul> element.
Attempts:
2 left
💡 Hint
Bootstrap provides responsive horizontal list group classes with breakpoints like '-sm', '-md', '-lg'.
accessibility
advanced
1: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?
Arole="list"
Brole="menu"
Crole="listbox"
Drole="navigation"
Attempts:
2 left
💡 Hint
A list group is a simple list, so use the ARIA role that matches a list structure.
🧠 Conceptual
expert
2:30remaining
What happens if you nest a
Consider this code snippet:
  • Item 2
What is the expected behavior and accessibility impact?
AThe button renders styled as a list group item and is keyboard accessible; however, nesting a button directly inside a <ul> is invalid HTML and may cause accessibility issues.
BThe button will not be styled as a list group item and will behave like a normal button outside the list group styling.
CThe browser will automatically convert the button into a <li> element to fix the invalid nesting.
DThe button will cause a runtime error and prevent the page from rendering.
Attempts:
2 left
💡 Hint
Think about HTML semantics and valid nesting rules for lists and buttons.