Give motion a clear purpose
CSS animations connect a named set of keyframes to an element. They are useful for a loading indicator or a brief entrance effect, but movement should explain a change rather than compete with the content. Decide what the animation communicates before tuning its timing.
How to use this tool
- Choose the properties you want to animate and define the starting and ending keyframes. Start with opacity or transform for a simple entrance.
- Set duration, delay, easing, and repeat behavior. Use a single iteration for an entrance and repeat only when the motion communicates an ongoing state.
- Copy both the @keyframes block and the animation declaration. Add an alternative for visitors who prefer reduced motion.
The example moves a panel only eight pixels while fading it in. The both fill mode applies the first frame during a delay and the final frame afterward. Content remains visible when the animation is disabled.
Read the reference documentation ↗