CSS transition Property
Description
The transition CSS property enables smooth interpolation between two states of an element by animating changes to other CSS properties over time. Rather than an immediate jump from one value to another, transitions interpolate intermediate values so changes appear gradual and natural. Transitions are typically used to animate state changes caused by user interaction (for example when a class is toggled or a pseudo-class like :hover is applied), and they only run when a property with an animatable value actually changes.
Under the hood a transition watches for changes to one or more animatable properties and then interpolates those properties from their current values to the new values using timing characteristics you define. Not all CSS properties are suitable for transitions — some are animatable on the compositor thread (cheap to animate) while others force layout and paint work (expensive). For smooth, high-performance transitions prefer properties handled on the compositor such as transform and opacity; animating properties that change layout (for example width/height or certain box-model properties) can cause jank because the browser must recalc layout and repaint.
Transitions are great for simple, state-driven motion: telling the browser to ease a color change, move or scale an element slightly, or fade content in and out in response to a direct change. For more complex or keyframed sequences, or when you need repeated/looped motion and more control over steps and callbacks, consider using CSS animation instead. Also keep in mind practical considerations such as interruption (a new change can cancel or queue a running transition), composing with other effects, and using transition-related events to coordinate logic after a transition finishes.
Definition
- Initial value
- see individual properties
- Applies to
- All elements, :before and :after pseudo elements
- Inherited
- No
- Computed value
- See individual properties
- Animatable
- No
- JavaScript syntax
- object.style.transition
Interactive Demo
to see transition.
Syntax
transition: <single-transition> [ ',' <single-transition> ]*
Values
- <transition-property>See transition-property CSS property for values.
- <transition-duration>See transition-duration CSS property for values.
- <transition-timing-function>See transition-timing-function CSS property for values.
- <transition-delay>See transition-delay CSS property for values.
Example
Browser Support
The following information will show you the current browser support for the CSS transition property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
