Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to add the carousel indicators container.
Bootsrap
<div id="carouselExampleIndicators" class="carousel slide" data-bs-ride="carousel"> <[1] class="carousel-indicators"> <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button> <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" aria-label="Slide 2"></button> <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="2" aria-label="Slide 3"></button> </[1]> </div>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
✗ Incorrect
The carousel indicators container is a
element with class 'carousel-indicators'.
2fill in blank
mediumComplete the code to add the attribute that links each indicator button to the carousel.
Bootsrap
<button type="button" [1]="#carouselExampleIndicators" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'href' which is for links, not carousel buttons.
Using 'aria-controls' which is for accessibility but not the target link.
✗ Incorrect
The 'data-bs-target' attribute links the button to the carousel's id.
3fill in blank
hardFix the error in the attribute that specifies which slide the button controls.
Bootsrap
<button type="button" data-bs-target="#carouselExampleIndicators" [1]="0" class="active" aria-current="true" aria-label="Slide 1"></button>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'data-slide-to' without 'bs-' prefix which is from older Bootstrap versions.
Using 'data-bs-slide' which controls slide direction, not index.
✗ Incorrect
The correct attribute to specify the slide number is 'data-bs-slide-to'.
4fill in blank
hardFill both blanks to add the correct ARIA attributes for accessibility on the active indicator button.
Bootsrap
<button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="active" [1]="true" [2]="Slide 1"></button>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'aria-checked' which is for checkboxes, not carousel indicators.
Using 'aria-hidden' which hides elements from screen readers.
✗ Incorrect
The active indicator uses 'aria-current="true"' and 'aria-label' to describe the slide.
5fill in blank
hardFill all three blanks to complete the carousel indicators with correct attributes and classes.
Bootsrap
<div class="carousel-indicators"> <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="0" class="[1]" aria-current="true" aria-label="[2]"></button> <button type="button" data-bs-target="#carouselExampleIndicators" data-bs-slide-to="1" class="" aria-label="[3]"></button> </div>
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to add 'active' class on the first button.
Using wrong aria-label text that doesn't match the slide number.
✗ Incorrect
The first button is active with class 'active' and label 'Slide 1'; the second button label is 'Slide 2'.