Skip to main content

Css Transition-delay Example


The transition-delay CSS property specifies the duration to wait before starting a property's transition effect when its value changes.

The delay may be zero, positive, or negative:

  • A value of 0s (or 0ms) will begin the transition effect immediately.
  • A positive value will delay the start of the transition effect for the given length of time.
  • A negative value will begin the transition effect immediately, and partway through the effect. In other words, the effect will be animated as if it had already been running for the given length of time.

You may specify multiple delays, which is useful when transitioning multiple properties. Each delay will be applied to the corresponding property as specified by the transition-property property, which acts as a master list. If there are fewer delays specified than in the master list, the list of delay values will be repeated until there are enough. If there are more delays, the list of delay values will be truncated to match the number of properties. In both cases, the CSS declaration remains valid.


Syntax


/* <time> values */
transition-delay: 3s;
transition-delay: 2s, 4ms;

/* Global values */
transition-delay: inherit;
transition-delay: initial;
transition-delay: unset;

Values


<time>
Denotes the amount of time to wait between a property's value changing and the start of the transition effect.

Formal definition























Initial value0s
Applies toall elements, ::before and ::after pseudo-elements
Inheritedno
Computed valueas specified
Animation typediscrete

Formal syntax


<time>#

Examples


A series of examples with different delays set

transition-delay: 0.5s

transition-delay: 1s

transition-delay: 2s

transition-delay: 4s

Specifications


Specification Status Comment
CSS Transitions
The definition of 'transition-delay' in that specification.
Working Draft Initial definition

Browser compatibility








































DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariWebView AndroidChrome AndroidFirefox for AndroidOpera AndroidSafari on IOSSamsung Internet
transition-delay
26

1


12

12


16

4

49

44


10

10


12.1

15

11.6-15


9

4


≤37

2


26

18


16

4

49

44


12.1

14

12-14


9

2


1.5

1.0


See also




Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable