Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Combining Transitions | Creating Smooth Transitions in CSS
Advanced CSS Techniques

bookCombining Transitions

We can combine all transition-related properties into one line.

transition: <property> <time> <time_function> <delay>;

Let's imagine we need to add a transition property to the element. We expect:

  • the change of the background-color property;
  • the time duration is 1.2s;
  • the time function must be ease-in-out;
  • the delay is 250ms.

Long form

transition-property: background-color;
transition-duration: 1200ms;
transition-timing-function: ease-in-out;
transition-delay: 250ms;

Shorthand form

transition: background-color 1200ms ease-in-out 250ms;

Note

There isn't any difference in syntax for the browser. We can select any option we like more.

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 6

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Suggested prompts:

Mi faccia domande su questo argomento

Riassuma questo capitolo

Mostri esempi dal mondo reale

Awesome!

Completion rate improved to 2.04

bookCombining Transitions

Scorri per mostrare il menu

We can combine all transition-related properties into one line.

transition: <property> <time> <time_function> <delay>;

Let's imagine we need to add a transition property to the element. We expect:

  • the change of the background-color property;
  • the time duration is 1.2s;
  • the time function must be ease-in-out;
  • the delay is 250ms.

Long form

transition-property: background-color;
transition-duration: 1200ms;
transition-timing-function: ease-in-out;
transition-delay: 250ms;

Shorthand form

transition: background-color 1200ms ease-in-out 250ms;

Note

There isn't any difference in syntax for the browser. We can select any option we like more.

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 3. Capitolo 6
some-alt