Retour au cours

Lesson 92: Transition Timing Function and Delay

**La Maîtrise de CSS : De zéro à expert en 100 leçons** *(Alternative, slightly punchier version using a common French idiomatic structure for full coverage: CSS : Maîtrisez l'essentiel en 100 leçons, but the first option is closer to the original progression.)*

92. Transition Timing Function and Delay

Beyond duration, we control the speed curve of the transition and when it starts.

3. transition-timing-function

Defines the acceleration curve of the transition, making it appear more natural.

ValueDescription
ease (default)Slow start, fast middle, slow end (most natural).
linearSame speed from start to end.
ease-inSlow start.
ease-outSlow end.
ease-in-outSlow start and slow end.
cubic-bezier(...)Custom speed curve (advanced).

css .box { transition-timing-function: ease-in-out; }

4. transition-delay

Defines how long to wait before starting the transition (in s or ms).

css .delayed-action:hover { /* Wait 200ms before starting the transition */ transition-delay: 200ms; }

The Transition Shorthand (Recommended)

It is best practice to use the transition shorthand property.

transition: <property> <duration> <timing-function> <delay>;

css .smooth-item { /* Transitions all properties over 0.3 seconds, easing in and out */ transition: all 0.3s ease-in-out 0s; }

.multiple-transition { /* Transition opacity over 0.2s, then transition color over 0.5s */ transition: opacity 0.2s, color 0.5s; }