Course contentsShow
← Web Development
Lesson 507 of 2,9829. CSS Transitions and AnimationsFree lesson

The Shorthand transition Property

Combining property, duration, timing function, and delay into a single declaration.

The Shorthand transition Property

What you'll learn: How to write all your transition values in a single, compact CSS declaration instead of using four separate properties.

Writing Multiple Properties Gets Tedious

You've learned that CSS transitions require up to four separate properties: transition-property, transition-duration, transition-timing-function, and transition-delay. Writing all four every time is verbose and repetitive. The transition shorthand property lets you combine them into one line.

The Shorthand Syntax

The transition shorthand follows this order:

transition: property duration timing-function delay;

Example:

.button {
  transition: background-color 0.3s ease-in-out 0.1s;
}

This single line replaces:

.button {
  transition-property: background-color;
  transition-duration: 0.3s;
  transition-timing-function: ease-in-out;
  transition-delay: 0.1s;
}

Flexibility and Defaults

You don't need to specify all four values. The shorthand is smart about what you include:

/* Just property and duration */
transition: opacity 0.5s;

/* Property, duration, and timing function */
transition: transform 0.4s ease-out;

The browser will use default values for anything you omit (linear timing function, 0s delay).

Multiple Transitions at Once

You can even animate multiple properties by separating them with commas:

.card {
  transition: transform 0.3s ease, opacity 0.5s linear;
}

Key Takeaway: The transition shorthand condenses up to four properties into one declaration, making your CSS cleaner while maintaining full control over property, duration, timing function, and delay.