Challenge - 5 Problems
Spinner Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate1:30remaining
What will you see when this Tailwind spinner runs?
Look at this HTML snippet using Tailwind CSS. What is the visual result in the browser?
Tailwind
<div class="w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full animate-spin" aria-label="Loading spinner"></div>
Attempts:
2 left
💡 Hint
The class 'animate-spin' makes the element rotate continuously.
✗ Incorrect
The element is a circle with a blue border except the top border is transparent. The 'animate-spin' class makes it rotate, creating a spinner effect.
❓ selector
intermediate1:30remaining
Which Tailwind class controls the speed of the spin animation?
You want to make the spinner spin slower. Which class should you add or change?
Tailwind
<div class="w-10 h-10 border-4 border-green-600 border-t-transparent rounded-full animate-spin" aria-label="Loading spinner"></div>
Attempts:
2 left
💡 Hint
Tailwind uses 'duration-
✗ Incorrect
The 'animate-spin' class triggers the spin animation. Adding 'duration-1000' sets the animation duration to 1000ms (1 second), slowing the spin.
🧠 Conceptual
advanced1:30remaining
Why is the top border made transparent in a Tailwind spinner?
Consider this spinner:
border-4 border-blue-500 border-t-transparent rounded-full animate-spin. Why is the top border transparent?Attempts:
2 left
💡 Hint
Think about how a spinning circle looks if all borders are the same color.
✗ Incorrect
Making the top border transparent creates a gap in the circle's border. When the circle spins, this gap moves, making the rotation visible as a loading spinner.
❓ layout
advanced2:00remaining
How to center a Tailwind spinner both vertically and horizontally?
You want to place the spinner exactly in the center of the page. Which container class setup achieves this?
Tailwind
<div class="???"> <div class="w-16 h-16 border-4 border-purple-600 border-t-transparent rounded-full animate-spin" aria-label="Loading spinner"></div> </div>
Attempts:
2 left
💡 Hint
Flexbox with 'items-center' and 'justify-center' centers content both ways.
✗ Incorrect
Using 'flex' makes the container a flexbox. 'items-center' centers vertically, 'justify-center' centers horizontally. 'min-h-screen' ensures full viewport height.
❓ accessibility
expert2:00remaining
What is the best ARIA attribute to make a spinner accessible?
You have a spinner element. Which ARIA attribute best informs screen readers that loading is in progress?
Tailwind
<div class="w-12 h-12 border-4 border-red-500 border-t-transparent rounded-full animate-spin" ???></div>Attempts:
2 left
💡 Hint
Use a role that announces status changes and a label describing the spinner.
✗ Incorrect
The 'role="status"' tells screen readers this is a live status update. 'aria-label' describes the spinner's purpose. This combination makes loading state clear.