HOVER ME
Hover to preview
Generated CSS

CSS Transition Generator

CSS transitions animate property changes smoothly over time. When a property value changes — usually on hover, focus or class toggle — the transition defines how long the change takes, its timing function (easing) and any delay before it starts.

Transition Shorthand Syntax

.element {
  /* property | duration | easing | delay */
  transition: transform 300ms ease-in-out 0ms;

  /* Multiple transitions */
  transition:
    transform 300ms ease-out,
    opacity 200ms ease,
    background-color 400ms ease-in-out;
}

Easing Functions Explained

FunctionBehaviourBest for
easeSlow start, fast middle, slow endGeneral purpose
ease-inSlow start, fast endExit animations
ease-outFast start, slow endEnter animations
ease-in-outSlow start and endReversible transitions
linearConstant speedProgress bars, loaders
cubic-bezier()Custom curveSpring/bounce effects

Frequently Asked Questions

What's the difference between transition and animation?

A transition triggers on a state change (hover, focus, class toggle) and runs once between two states. An animation (@keyframes) runs automatically, can loop, and can define multiple intermediate states. Use transitions for UI feedback, animations for decorative motion.

Which CSS properties can be transitioned?

Any property with a numeric or color value can be transitioned — opacity, transform, background-color, width, box-shadow, etc. Properties like display and visibility are not animatable (use opacity instead of display:none).

Should I transition all or specific properties?

Prefer specific properties over transition: all. Using all can trigger unintended transitions on properties you didn't mean to animate and reduces performance. Only transition the properties that actually change.

How do I make a transition respect prefers-reduced-motion?

Wrap your transitions in a media query: @media (prefers-reduced-motion: no-preference) { .el { transition: transform 300ms ease; } }. This disables transitions for users who have requested reduced motion in their OS settings.

Related tools: CSS Animation Generator · Cubic Bezier Generator · CSS Transform Generator

Tool last updated: