CSS animation for beginners: transition, keyframes and easing
A clear guide to CSS animation: transition vs keyframes, how to pick duration and easing, and why some animations look premium and others cheap.

To add animation or ask an AI for it well, three basics help. No extra theory.
transition: smooth state change
.button { transition: transform .2s ease-out; }
.button:hover { transform: translateY(-2px); }keyframes: a motion script
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.04); }
}
.badge { animation: pulse 2s ease-in-out infinite; }
Easing: the character of motion
- ease-out: fast start, soft stop. Best for appearing and feedback.
- ease-in-out: moving across the screen.
- linear: only for endless spins and marquees.
- ease-in is rarely right in UI: it feels slow.
Duration
- Press: 100–160 ms.
- Hover and tooltips: 150–250 ms.
- Menus and modals: 200–400 ms.
- Big landing scenes: up to 1 second.
Why animation looks cheap
- Everything appears at once: add a small stagger.
- Too slow: the UI feels laggy.
- Strong bounce: cartoonish for a serious product.
Catalog components follow these rules, so use them as living examples.




