0
0
Bootsrapmarkup~20 mins

Spinner components in Bootsrap - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Spinner Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
2: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>
AA spinning square with visible text 'Loading...'
BA blue circular spinner rotating with hidden text for screen readers
CA static blue circle with visible text 'Loading...'
DNo spinner visible, only the text 'Loading...' shown
Attempts:
2 left
💡 Hint
Remember that 'spinner-border' creates a rotating circle and 'visually-hidden' hides text visually but keeps it for screen readers.
📝 Syntax
intermediate
2: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?
A
&lt;div class="spinner-grow text-success" role="status"&gt;
  &lt;span class="visually-hidden"&gt;Loading...&lt;/span&gt;
&lt;/div&gt;
B
&lt;div class="spinner-border-grow text-success" role="status"&gt;
  &lt;span class="visually-hidden"&gt;Loading...&lt;/span&gt;
&lt;/div&gt;
C
&lt;div class="spinner-grow text-success" aria-hidden="true"&gt;
  Loading...
&lt;/div&gt;
D
&lt;div class="spinner-grow-border text-success" role="status"&gt;
  &lt;span class="visually-hidden"&gt;Loading...&lt;/span&gt;
&lt;/div&gt;
Attempts:
2 left
💡 Hint
The correct class for a growing spinner is 'spinner-grow'.
accessibility
advanced
2: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?
Arole="alert"
Brole="presentation"
Crole="progressbar"
Drole="status"
Attempts:
2 left
💡 Hint
The spinner indicates loading status but does not show progress percentage.
layout
advanced
2: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?
AWrap spinner in a div with 'position-absolute top-50 start-50' and no transform
BUse 'text-center' on the spinner and set margin-top: 50vh in CSS
CUse a container with classes 'd-flex justify-content-center align-items-center vh-100' wrapping the spinner
DUse 'mx-auto my-auto' on spinner with fixed width and height
Attempts:
2 left
💡 Hint
Flexbox utilities in Bootstrap can center content easily.
🧠 Conceptual
expert
3: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?
A'spinner-border' because its continuous rotation visually indicates ongoing activity without implying progress
B'spinner-grow' because its expanding animation suggests progress completion over time
C'spinner-border' because it uses less CPU and battery on devices
D'spinner-grow' because it is more accessible for screen readers
Attempts:
2 left
💡 Hint
Think about what the animation communicates to users about loading.