Challenge - 5 Problems
Bounce Animation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate1:30remaining
What will this Tailwind CSS code visually do?
Look at this HTML snippet using Tailwind CSS classes. What animation effect will the blue button show when viewed in a browser?
Tailwind
<button class="bg-blue-500 text-white font-bold py-2 px-4 rounded animate-bounce">Click me</button>Attempts:
2 left
💡 Hint
The class 'animate-bounce' in Tailwind triggers a vertical bouncing effect.
✗ Incorrect
The animate-bounce class in Tailwind CSS applies a keyframe animation that moves the element up and down repeatedly, creating a bouncing effect.
❓ selector
intermediate1:30remaining
Which Tailwind class controls the speed of the bounce animation?
You want to set the bounce animation duration to 1000ms. Which Tailwind CSS class should you add or change?
Attempts:
2 left
💡 Hint
Tailwind uses duration classes to control animation speed in milliseconds.
✗ Incorrect
The duration-1000 class sets the animation duration to 1000 milliseconds (1 second).
🧠 Conceptual
advanced2:00remaining
Why is using
animate-bounce good for attention but bad for accessibility if overused?Consider a webpage with many elements using the bounce animation. What is a key accessibility concern?
Attempts:
2 left
💡 Hint
Think about users who might be sensitive to motion or flashing effects.
✗ Incorrect
Excessive motion animations like bouncing can cause dizziness or distraction for users with vestibular disorders or motion sensitivity. It's best to use such animations sparingly and provide options to disable them.
📝 Syntax
advanced1:30remaining
What error will this Tailwind class combination cause?
Look at this button code:
What happens when the page loads?
<button class="animate-bounce duration-xyz">Bounce</button>What happens when the page loads?
Tailwind
<button class="animate-bounce duration-xyz">Bounce</button>Attempts:
2 left
💡 Hint
Invalid Tailwind classes are usually ignored, not breaking the page.
✗ Incorrect
Tailwind ignores unknown classes like duration-xyz. The animation runs with the default duration.
❓ layout
expert2:30remaining
How to center a bouncing button horizontally and vertically using Tailwind CSS?
You want a button with bounce animation to appear exactly in the center of the viewport. Which Tailwind class set achieves this best?
Tailwind
<button class="bg-red-500 text-white font-bold py-2 px-4 rounded animate-bounce">Bounce</button>Attempts:
2 left
💡 Hint
Flexbox with center alignment is a common way to center content both ways.
✗ Incorrect
Using a parent div with flex, items-center, and justify-center centers the button horizontally and vertically. The h-screen and w-screen make the div fill the viewport.