<button class="bg-blue-500 text-white font-bold py-2 px-4 rounded animate-bounce">Click me</button>The animate-bounce class in Tailwind CSS applies a keyframe animation that moves the element up and down repeatedly, creating a bouncing effect.
The duration-1000 class sets the animation duration to 1000 milliseconds (1 second).
animate-bounce good for attention but bad for accessibility if overused?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.
<button class="animate-bounce duration-xyz">Bounce</button>What happens when the page loads?
<button class="animate-bounce duration-xyz">Bounce</button>Tailwind ignores unknown classes like duration-xyz. The animation runs with the default duration.
<button class="bg-red-500 text-white font-bold py-2 px-4 rounded animate-bounce">Bounce</button>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.
