Carousel indicators are small clickable buttons or dots that show which slide is currently active in a Bootstrap carousel. They help users navigate between slides easily.
Click to reveal answer
beginner
How do you link carousel indicators to specific slides in Bootstrap?
Each indicator button uses the data-bs-target attribute to point to the carousel's ID and the data-bs-slide-to attribute to specify the slide number (starting from 0).
Click to reveal answer
intermediate
Why is the aria-current="true" attribute used on a carousel indicator?
It marks the active indicator for screen readers, improving accessibility by telling users which slide is currently shown.
Click to reveal answer
beginner
What role does the <code>active</code> class play in carousel indicators?
The <code>active</code> class highlights the current indicator visually, showing which slide is active in the carousel.
Click to reveal answer
intermediate
How can you make carousel indicators keyboard accessible?
Bootstrap's carousel indicators are buttons by default, so they can be focused and activated using keyboard keys like Tab and Enter, supporting keyboard navigation.
Click to reveal answer
Which attribute connects a carousel indicator to the carousel element?
Adata-bs-target
Bdata-slide
Chref
Did
✗ Incorrect
The data-bs-target attribute points to the carousel's ID, linking the indicator to the carousel.
What value does data-bs-slide-to use to indicate the first slide?
A1
Bfirst
C-1
D0
✗ Incorrect
Slide numbering starts at 0, so the first slide uses data-bs-slide-to="0".
Which class marks the active carousel indicator?
Aactive
Bselected
Ccurrent
Dhighlight
✗ Incorrect
The active class visually highlights the current indicator.
Why are carousel indicators usually buttons instead of links?
ALinks are deprecated in Bootstrap
BLinks cannot be styled
CButtons support keyboard focus and activation better
DButtons load faster
✗ Incorrect
Buttons are better for accessibility because they support keyboard navigation and activation.
What does the aria-current="true" attribute do on an indicator?
ADisables the indicator
BMarks it as the current slide for screen readers
CChanges its color
DMakes it clickable
✗ Incorrect
aria-current="true" tells assistive technologies which indicator is active.
Explain how carousel indicators work in Bootstrap and how they improve user experience.
Think about how users know which slide is active and how they can jump to another slide.
You got /4 concepts.
Describe the accessibility features you should include when creating carousel indicators.
Consider how people using keyboards or screen readers interact with the carousel.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of carousel indicators in Bootstrap?
easy
A. To show which slide is active and allow users to select slides
B. To add captions to each slide
C. To control the speed of the carousel
D. To add navigation arrows to the carousel
Solution
Step 1: Understand the role of carousel indicators
Carousel indicators are small buttons or dots that show which slide is currently visible.
Step 2: Identify user interaction purpose
They also let users click to jump to a specific slide.
Final Answer:
To show which slide is active and allow users to select slides -> Option A
Quick Check:
Carousel indicators = show active slide + select slides [OK]
Hint: Indicators show active slide and let users pick slides [OK]
Common Mistakes:
Confusing indicators with captions
Thinking indicators control speed
Mixing indicators with navigation arrows
2. Which HTML element is recommended for Bootstrap carousel indicators to ensure accessibility?
easy
A. <button>
B. <div>
C. <a>
D. <span>
Solution
Step 1: Identify accessible element for interaction
Buttons are interactive elements that support keyboard and screen reader accessibility by default.
Step 2: Bootstrap documentation recommendation
Bootstrap uses <button> elements for carousel indicators to ensure proper ARIA roles and keyboard focus.
Final Answer:
<button> -> Option A
Quick Check:
Use <button> for accessible carousel indicators [OK]
Hint: Use <button> for accessible clickable indicators [OK]
Common Mistakes:
Using <div> which is not keyboard accessible
Using <a> without href causing accessibility issues
Using <span> which is not interactive
3. Given this snippet inside a Bootstrap carousel: