Challenge - 5 Problems
Ping Animation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What will you see with this Tailwind ping animation code?
Look at this HTML snippet using Tailwind CSS classes for a ping animation on a notification dot. What is the visible effect in the browser?
Tailwind
<div class="relative flex items-center justify-center w-10 h-10 bg-gray-200 rounded-full"> <span class="absolute inline-flex h-3 w-3 top-1 right-1"> <span class="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"></span> <span class="relative inline-flex rounded-full h-3 w-3 bg-red-500"></span> </span> </div>
Attempts:
2 left
💡 Hint
Focus on the animate-ping class and how it affects the inner span.
✗ Incorrect
The animate-ping class in Tailwind creates a continuous expanding and fading circle effect behind the solid dot, simulating a ping or pulse animation.
❓ selector
intermediate1:30remaining
Which Tailwind class controls the speed of the ping animation?
Given the ping animation uses the class animate-ping, which class would you add or modify to make the ping animation slower?
Attempts:
2 left
💡 Hint
Tailwind uses duration- classes to control animation speed in milliseconds.
✗ Incorrect
The duration-3000 class sets the animation duration to 3000ms (3 seconds), making the ping animation slower than the default.
🧠 Conceptual
advanced2:00remaining
Why is the ping animation wrapped in two nested spans in this Tailwind example?
Consider this structure:
Why are there two spans inside the outer span?
Attempts:
2 left
💡 Hint
Think about layering and how animations and static elements combine visually.
✗ Incorrect
The first inner span uses animate-ping to create the expanding circle behind, while the second inner span is the solid dot that stays visible on top.
❓ accessibility
advanced2:00remaining
How to improve accessibility for a ping notification dot in Tailwind?
You have a red ping dot indicating new notifications. Which addition improves screen reader accessibility?
Tailwind
<span class="relative inline-flex h-3 w-3 rounded-full bg-red-500"></span>Attempts:
2 left
💡 Hint
Think about how screen readers get information about visual indicators.
✗ Incorrect
Adding aria-label and role="status" helps screen readers announce the notification presence, improving accessibility beyond color alone.
❓ layout
expert2:30remaining
How to position a ping notification dot at the top-right corner of a profile picture using Tailwind?
You have a profile picture inside a div with class "relative w-16 h-16 rounded-full overflow-hidden". Which code snippet correctly places a ping dot at the top-right corner overlapping the picture?
Attempts:
2 left
💡 Hint
Remember the parent div is relative, so use absolute positioning on the dot.
✗ Incorrect
Using absolute positioning with top-0 and right-0 places the ping dot exactly at the top-right corner inside the relative parent. Fixed positioning would place it relative to the viewport, which is incorrect.