Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Transforms, Transitions and Animations

The transition-property property

Reference for the CSS transition-property property: choose which properties animate with none, all or a list of names, with syntax, examples and support.

The transition-property property names the CSS properties that should change gradually when their value changes. Properties that are not listed change instantly, as usual.

It is one of the longhands of the transition shorthand. You need a non-zero transition-duration as well; the property list alone produces no motion.

CSS
.card {
  transition-property: opacity, transform;
  transition-duration: 300ms;
}

Try it

Only some properties transition

Syntax

CSS
transition-property: none | <single-transition-property>#

<single-transition-property> = all | <custom-ident>
  • Initial value: all
  • Applies to: all elements, and the ::before and ::after pseudo-elements
  • Inherited: no
  • Animatable: no
  • Computed value: as specified

Values

Value Description
all Every animatable property that changes will transition. This is the default.
none No property transitions. Running transitions stop immediately.
<custom-ident> The name of a CSS property, such as opacity, background-color or --my-property.
Comma-separated list Several names, for example opacity, transform.

Using the name of a shorthand such as border or margin transitions all of its longhands.

Usage notes

  • all is the default, but harmless only with a zero duration. As soon as you set a duration, every animatable property that changes will animate. List the properties you mean instead.
  • Lists line up by position. Other transition properties are also comma-separated lists, and the nth value of each belongs to the nth property. If a list is shorter, it repeats; if it is longer, extra values are ignored.
  • Unknown names are fine. A name that is not a known property is simply ignored, so a typo fails silently.
  • Not every property animates. Discrete properties such as display or font-family flip instantly unless you add transition-behavior: allow-discrete. Values like height: auto cannot be interpolated by default.
  • Custom properties. A custom property only transitions if you have registered a type for it with @property; otherwise it is treated as plain text and flips.
  • Pick cheap properties. opacity and transform are the safest choices for smooth motion.
  • Both directions. Declare the property on the element's base rule, so it animates when the state starts and when it ends.

Browser support

Supported in every browser.