Bird
Raised Fist0
Tailwindmarkup~20 mins

Bounce animation (attention) in Tailwind - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Bounce Animation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate
1: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>
AThe button will fade in and out slowly.
BThe button will smoothly bounce up and down repeatedly.
CThe button will spin continuously.
DThe button will shake left and right quickly.
Attempts:
2 left
💡 Hint
The class 'animate-bounce' in Tailwind triggers a vertical bouncing effect.
❓ selector
intermediate
1: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?
Aduration-1000
Banimate-slow
Cspeed-bounce
Danimate-duration
Attempts:
2 left
💡 Hint
Tailwind uses duration classes to control animation speed in milliseconds.
🧠 Conceptual
advanced
2: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?
ABounce animations cause the page to lose color contrast.
BBounce animations slow down page loading speed significantly.
CBounce animations prevent screen readers from reading the content.
DToo much bouncing can distract or cause discomfort for users with motion sensitivity.
Attempts:
2 left
💡 Hint
Think about users who might be sensitive to motion or flashing effects.
📝 Syntax
advanced
1:30remaining
What error will this Tailwind class combination cause?
Look at this button code:
<button class="animate-bounce duration-xyz">Bounce</button>
What happens when the page loads?
Tailwind
<button class="animate-bounce duration-xyz">Bounce</button>
AThe animation runs with default speed; 'duration-xyz' is ignored.
BThe browser throws a syntax error and stops rendering the button.
CThe animation does not run because 'duration-xyz' is invalid and breaks Tailwind.
DThe button bounces but with a very fast speed.
Attempts:
2 left
💡 Hint
Invalid Tailwind classes are usually ignored, not breaking the page.
❓ layout
expert
2: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>
AUse 'absolute top-1/2 left-1/2' on the button without transform
BAdd classes 'mx-auto my-auto' directly to the button
CWrap the button in a div with classes: 'flex items-center justify-center h-screen w-screen'
DWrap the button in a div with 'grid place-items-start h-full w-full'
Attempts:
2 left
💡 Hint
Flexbox with center alignment is a common way to center content both ways.

Practice

(1/5)
1. What does the Tailwind CSS class animate-bounce do to an element?
easy
A. Rotates the element 360 degrees
B. Changes the element's color to red
C. Makes the element move up and down repeatedly to attract attention
D. Makes the element fade out slowly

Solution

  1. Step 1: Understand the purpose of animate-bounce

    The animate-bounce class in Tailwind CSS applies a smooth up-and-down movement to the element.
  2. Step 2: Compare with other animation effects

    Other options describe color change, rotation, or fading, which are not what animate-bounce does.
  3. Final Answer:

    Makes the element move up and down repeatedly to attract attention -> Option C
  4. Quick Check:

    Bounce animation = up and down movement [OK]
Hint: Bounce means moving up and down smoothly [OK]
Common Mistakes:
  • Confusing bounce with color or rotation animations
  • Thinking it fades the element
  • Assuming it moves side to side
2. Which of the following is the correct way to apply a bounce animation to a button using Tailwind CSS?
easy
A. Click me
B. Click me
C. Click me
D. Click me

Solution

  1. Step 1: Recall the exact Tailwind class for bounce animation

    The correct class is animate-bounce, not variations like bounce-animation or bounce.
  2. Step 2: Check the button element syntax

    Click me uses class="animate-bounce" correctly on the button element.
  3. Final Answer:

    <button class="animate-bounce">Click me</button> -> Option B
  4. Quick Check:

    Use animate-bounce class exactly [OK]
Hint: Use exact class name: animate-bounce [OK]
Common Mistakes:
  • Adding extra words to the class name
  • Using incomplete or incorrect class names
  • Forgetting to add the class attribute
3. What will you see when you open this HTML snippet in a browser?
<button class="animate-bounce bg-blue-500 text-white p-4 rounded">Bounce</button>
medium
A. A blue button that smoothly moves up and down repeatedly
B. A static blue button with no movement
C. A button that fades in and out
D. A button that spins continuously

Solution

  1. Step 1: Analyze the classes applied

    The button has animate-bounce for bounce animation, bg-blue-500 for blue background, text-white for white text, p-4 for padding, and rounded for rounded corners.
  2. Step 2: Predict the visual output

    The button will appear blue with white text and will bounce up and down smoothly.
  3. Final Answer:

    A blue button that smoothly moves up and down repeatedly -> Option A
  4. Quick Check:

    animate-bounce = smooth up/down movement [OK]
Hint: Look for animate-bounce to see bouncing effect [OK]
Common Mistakes:
  • Ignoring the animate-bounce class effect
  • Confusing bounce with fade or spin
  • Assuming no animation without checking classes
4. You want a text element to bounce but your code <p class="bounce">Hello</p> does not animate. What is the problem?
medium
A. The <p> tag cannot be animated
B. Animations only work on buttons, not text
C. You need to add animation-bounce instead
D. The class name should be animate-bounce, not bounce

Solution

  1. Step 1: Check the class name used

    The class bounce is not a valid Tailwind animation class. The correct class is animate-bounce.
  2. Step 2: Confirm element animatability

    Paragraph tags can be animated with Tailwind classes, so the tag is not the issue.
  3. Final Answer:

    The class name should be animate-bounce, not bounce -> Option D
  4. Quick Check:

    Use exact class animate-bounce [OK]
Hint: Use full class name animate-bounce for animation [OK]
Common Mistakes:
  • Using incomplete class names like bounce
  • Thinking only buttons animate
  • Assuming tag type blocks animation
5. You want to create a bouncing icon that stops bouncing when hovered over. Which Tailwind CSS setup achieves this?
hard
A. <div class="animate-bounce hover:animate-none">🔔</div>
B. <div class="animate-bounce hover:animate-bounce">🔔</div>
C. <div class="bounce hover:none">🔔</div>
D. <div class="animate-bounce hover:stop-bounce">🔔</div>

Solution

  1. Step 1: Understand Tailwind hover syntax

    Tailwind uses hover: prefix to apply styles on hover. To stop animation on hover, use hover:animate-none.
  2. Step 2: Check each option's correctness

    <div class="animate-bounce hover:animate-none">🔔</div> correctly uses animate-bounce and stops animation on hover with hover:animate-none. Other options use invalid classes or do not stop animation.
  3. Final Answer:

    <div class="animate-bounce hover:animate-none">🔔</div> -> Option A
  4. Quick Check:

    Use hover:animate-none to stop bounce on hover [OK]
Hint: Use hover:animate-none to pause bounce on hover [OK]
Common Mistakes:
  • Using invalid class names like bounce or stop-bounce
  • Not using hover prefix correctly
  • Assuming hover disables animation without class
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard