Skip to content
BENIBIX Learn

CSS Animation

Design🎞️ Motion & VideoAnimation

Also known as CSS Keyframes, @keyframes, CSS Animations

Keyframes written in CSS that the browser plays. It can loop and pass through many steps.

Think of it like

It is like a dance routine written on a card. The browser reads the steps and plays them on its own.

Example

A loading dot on Emma's site grows and shrinks once a second. It takes a few lines of CSS.

Why it matters

It adds looping motion to a page with no script. The browser runs it smoothly.

Definition

A CSS animation plays a set of keyframes written in CSS. You name the animation with an @keyframes rule and list how things look at points from 0% to 100%. Then you attach it to an element with a duration, an easing and how many times to repeat. Unlike a transition, it can run on its own, loop and pass through many states. It suits spinners, pulses and attention cues.

Example code

css
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
.dot {
  animation: pulse 1s ease-in-out infinite;
}
The dot grows and shrinks every second, on a loop.
An @keyframes rule sets the key moments; the browser tweens the rest.

Common mistake

A loop next to text people are reading. Motion that never ends pulls the eye away.

Key takeaways

  1. 1
    Keyframes in CSS. From 0% to 100%.
  2. 2
    Runs on its own. No hover needed.
  3. 3
    Can loop. Set how many times.

Compare