Recall & Review
beginner
What is an Accordion component in web development?
An Accordion is a UI element that lets users expand and collapse sections to show or hide content. It helps organize information in a small space.
Click to reveal answer
beginner
Which Bootstrap class is used to create the main container for an Accordion?The class
.accordion is used as the main container for grouping accordion items in Bootstrap.Click to reveal answer
intermediate
How do you make an Accordion item collapsible in Bootstrap?
Use the
data-bs-toggle="collapse" attribute on the button or link that controls the item, and connect it to a .collapse element with a unique ID.Click to reveal answer
intermediate
What role does the
aria-expanded attribute play in an Accordion?It tells screen readers if the Accordion section is open (
true) or closed (false), improving accessibility.Click to reveal answer
intermediate
How can you ensure only one Accordion item is open at a time in Bootstrap?
Set the same
data-bs-parent attribute on each collapsible content element, pointing to the Accordion container. This makes them behave like an exclusive group.Click to reveal answer
Which Bootstrap class wraps all Accordion items?
✗ Incorrect
The
.accordion class is the main container for all Accordion items.What attribute do you add to a button to toggle Accordion content?
✗ Incorrect
Use
data-bs-toggle="collapse" to make the button toggle the collapsible content.How do you link a button to the content it controls in Bootstrap Accordion?
✗ Incorrect
The button uses
href="#id" or data-bs-target="#id" to connect to the collapsible content.What does setting
data-bs-parent do in an Accordion?✗ Incorrect
It ensures only one Accordion item is open by linking all collapsible items to the same parent.
Which attribute improves Accordion accessibility for screen readers?
✗ Incorrect
aria-expanded tells screen readers if the section is open or closed.Explain how to build a basic Accordion component using Bootstrap.
Think about the structure and attributes needed for toggling.
You got /6 concepts.
Describe how accessibility is handled in a Bootstrap Accordion.
Focus on attributes that help screen readers understand the Accordion state.
You got /5 concepts.