Challenge - 5 Problems
Expandable Content Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why use expandable content in web design?
Which of the following best explains why expandable content helps save space on a webpage?
Attempts:
2 left
💡 Hint
Think about how showing or hiding information affects what you see on the page.
✗ Incorrect
Expandable content hides details until the user wants to see them. This keeps the page clean and easy to read.
📝 Syntax
intermediate2:00remaining
Bootstrap collapse syntax
Which Bootstrap code snippet correctly creates a button that toggles expandable content?
Attempts:
2 left
💡 Hint
Bootstrap 5 uses data-bs-toggle and data-bs-target attributes.
✗ Incorrect
Bootstrap 5 requires data-bs-toggle="collapse" and data-bs-target="#id" to toggle collapsible content.
❓ rendering
advanced2:00remaining
Visual effect of expandable content
What will the user see when they click the 'More Details' button in this Bootstrap example?
Bootsrap
<button class="btn btn-secondary" data-bs-toggle="collapse" data-bs-target="#details">More Details</button><div id="details" class="collapse">Here are extra details that were hidden.</div>
Attempts:
2 left
💡 Hint
Collapse toggles visibility without removing elements.
✗ Incorrect
Clicking the button toggles the hidden content to appear or disappear below it.
❓ selector
advanced2:00remaining
CSS selector for expanded content
Which CSS selector targets the expanded content when a Bootstrap collapse is shown?
Attempts:
2 left
💡 Hint
Bootstrap adds a class when content is visible.
✗ Incorrect
Bootstrap adds the show class to the collapse element when it is expanded.
❓ accessibility
expert3:00remaining
ARIA attributes for expandable content
Which ARIA attribute should be added to the toggle button to improve accessibility for expandable content?
Attempts:
2 left
💡 Hint
This attribute tells screen readers if content is visible or hidden.
✗ Incorrect
The aria-expanded attribute on the toggle button indicates whether the expandable content is currently shown (true) or hidden (false).