0
0
Tailwindmarkup~20 mins

Spin animation (loading) in Tailwind - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Spinner Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
rendering
intermediate
1: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>
AA static blue circle with no animation.
BA blue circle with a transparent top border that spins continuously.
CA blue square that fades in and out repeatedly.
DA blue circle that grows and shrinks but does not spin.
Attempts:
2 left
💡 Hint
The class 'animate-spin' makes the element rotate continuously.
selector
intermediate
1: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>
Aanimate-spin-slow
Banimate-spin duration-1000
Cspin-speed-2
Dduration-1000
Attempts:
2 left
💡 Hint
Tailwind uses 'duration-
🧠 Conceptual
advanced
1: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?
ATo create a visual gap that makes the spinning motion visible.
BTo reduce the spinner's size visually.
CTo disable the spinner's animation.
DTo make the spinner fade in and out.
Attempts:
2 left
💡 Hint
Think about how a spinning circle looks if all borders are the same color.
layout
advanced
2: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>
Aflex items-center justify-center min-h-screen
Bgrid place-items-start min-h-screen
Cblock mx-auto my-auto min-h-screen
Dinline-flex items-start justify-center min-h-screen
Attempts:
2 left
💡 Hint
Flexbox with 'items-center' and 'justify-center' centers content both ways.
accessibility
expert
2: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>
Aaria-hidden="true"
Baria-live="off"
Caria-label="Loading content" role="status"
Drole="presentation"
Attempts:
2 left
💡 Hint
Use a role that announces status changes and a label describing the spinner.