A list group in Bootstrap is a flexible and powerful component for displaying a series of content items in a vertical list with consistent spacing and styling.
Click to reveal answer
beginner
How do you create a basic list group in Bootstrap?
Use a <ul> or <div> with the class list-group. Each item inside should have the class list-group-item.
Click to reveal answer
beginner
How can you make a list group item active or highlighted?
Add the class active to the list-group-item you want to highlight. It changes the background and text color to show it is selected.
Click to reveal answer
intermediate
What class do you add to make list group items clickable links?
Use <a> tags with the class list-group-item list-group-item-action. This makes the items interactive and keyboard accessible.
Click to reveal answer
intermediate
How do you add badges or extra info to list group items?
Place a <span> with the class badge bg-primary rounded-pill inside the list-group-item. This shows a small colored label on the right side.
Click to reveal answer
Which class is required on the container to create a Bootstrap list group?
Alist-group
Blist-item
Cgroup-list
Dlist-container
✗ Incorrect
The container must have the class list-group to apply Bootstrap's list group styles.
How do you make a list group item appear selected or active?
AAdd class <code>selected</code>
BAdd class <code>active</code>
CAdd class <code>highlight</code>
DAdd class <code>focus</code>
✗ Incorrect
Adding the class active highlights the list group item as selected.
Which tag and classes make list group items clickable links?
A<code><button></code> with <code>list-group-item</code>
B<code><div></code> with <code>list-group-item-action</code>
C<code><a></code> with <code>list-group-item list-group-item-action</code>
D<code><span></code> with <code>list-group-item</code>
✗ Incorrect
Using <a> tags with both list-group-item and list-group-item-action makes items clickable and accessible.
What class combination is used to add a badge to a list group item?
Abadge-primary pill-rounded
Bbadge-pill bg-primary
Cbadge rounded bg-primary
Dbadge bg-primary rounded-pill
✗ Incorrect
The correct classes are badge bg-primary rounded-pill to style badges properly.
Which HTML element is NOT typically used for list group items?
A<code><table></code>
B<code><a></code>
C<code><button></code>
D<code><li></code>
✗ Incorrect
The <table> element is not used for list group items; list groups use <li>, <a>, or <button>.
Explain how to create a basic Bootstrap list group with three items, including one active item.
Think about the container and item classes needed.
You got /3 concepts.
Describe how to make list group items interactive links and add badges to them.
Focus on tags and classes for links and badges.
You got /2 concepts.
Practice
(1/5)
1. What is the main purpose of the Bootstrap list-group component?
easy
A. To organize and style a list of items cleanly
B. To create a navigation bar
C. To add buttons with icons
D. To display images in a grid
Solution
Step 1: Understand the role of list-group
The list-group component is designed to group related items in a list format.
Step 2: Compare with other components
Unlike navigation bars or grids, list-group focuses on listing items with consistent styling.
Final Answer:
To organize and style a list of items cleanly -> Option A
Quick Check:
List groups = styled item lists [OK]
Hint: Remember list groups are for clean lists, not nav or grids [OK]
Common Mistakes:
Confusing list group with navigation bar
Thinking it creates buttons or grids
Mixing it with image display components
2. Which of the following is the correct way to start a Bootstrap list group in HTML?
easy
A.
B.
C.
D.
Solution
Step 1: Identify the container class for list groups
Bootstrap requires the container to have the class list-group to apply styles.
Step 2: Choose the correct HTML element
Commonly, <ul> or <div> with list-group is used; here <ul> with class list-group is correct.
Final Answer:
<ul class="list-group"> -> Option C
Quick Check:
Use <ul> with class list-group [OK]
Hint: Use <ul> or <div> with class list-group to start [OK]
Common Mistakes:
Using wrong class names like list-item or group-list
Bootstrap uses <a> tags with classes list-group-item and list-group-item-action for clickable items.
Step 2: Check other options
<ul class="list-group">
<li class="list-group-item">Item 1</li>
<li class="list-group-item">Item 2</li>
</ul> uses non-clickable <li>, A misses list-group-item-action, D uses li without proper container and classes.
Final Answer:
Div with <a> tags having list-group-item and list-group-item-action classes -> Option D
Quick Check:
Clickable list items = <a> + list-group-item-action [OK]
Hint: Clickable list items use <a> with list-group-item-action class [OK]
Common Mistakes:
Using <li> without action class for clickable items
Missing list-group-item-action class
Using buttons without proper classes
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.