Challenge - 5 Problems
Spinner Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual output of this spinner code?
Look at the following Bootstrap spinner code. What will you see on the webpage?
Bootsrap
<div class="spinner-border text-primary" role="status"> <span class="visually-hidden">Loading...</span> </div>
Attempts:
2 left
💡 Hint
Remember that 'spinner-border' creates a rotating circle and 'visually-hidden' hides text visually but keeps it for screen readers.
✗ Incorrect
The 'spinner-border' class creates a rotating circular spinner. The 'text-primary' class colors it blue. The span with 'visually-hidden' hides the text visually but keeps it accessible for screen readers, so only the spinner is visible.
📝 Syntax
intermediate2:00remaining
Which option correctly creates a growing spinner in Bootstrap?
Bootstrap has two spinner types: border and growing. Which code snippet correctly creates a growing spinner?
Attempts:
2 left
💡 Hint
The correct class for a growing spinner is 'spinner-grow'.
✗ Incorrect
The class 'spinner-grow' creates a growing spinner. Options A and B use invalid class names. Option A hides the spinner from screen readers and shows visible text, which is not the recommended pattern.
❓ accessibility
advanced2:00remaining
What accessibility role should a spinner have for screen readers?
You want to make sure your spinner is accessible. Which ARIA role is correct to use on a spinner element?
Attempts:
2 left
💡 Hint
The spinner indicates loading status but does not show progress percentage.
✗ Incorrect
The 'status' role announces dynamic status updates to screen readers without interrupting. 'alert' is for urgent messages, 'progressbar' is for known progress, and 'presentation' hides from assistive tech.
❓ layout
advanced2:00remaining
How to center a Bootstrap spinner horizontally and vertically in a full viewport?
You want to place a spinner exactly in the center of the screen both horizontally and vertically. Which CSS approach works best with Bootstrap classes?
Attempts:
2 left
💡 Hint
Flexbox utilities in Bootstrap can center content easily.
✗ Incorrect
The 'd-flex' makes the container a flexbox, 'justify-content-center' centers horizontally, 'align-items-center' centers vertically, and 'vh-100' makes container full viewport height. This centers the spinner perfectly.
🧠 Conceptual
expert3:00remaining
Which spinner type is better for unknown loading duration and why?
Bootstrap offers 'spinner-border' and 'spinner-grow'. Which spinner type is more suitable when the loading time is unknown and why?
Attempts:
2 left
💡 Hint
Think about what the animation communicates to users about loading.
✗ Incorrect
'spinner-border' uses a rotating circle that implies ongoing activity without suggesting how much is done. 'spinner-grow' looks like something expanding, which can imply progress. For unknown durations, 'spinner-border' is clearer.