Proprietà CSS di ritardo dell'animazione
Esempio
Avvia l'animazione dopo 2 secondi:
div {
animation-delay: 2s;
}
Altri esempi "Provalo da solo" di seguito.
Definizione e utilizzo
La animation-delay
proprietà specifica un ritardo per l'inizio di un'animazione.
Il valore del ritardo dell'animazione è definito in secondi (s) o millisecondi (ms).
Valore di default: | 0s |
---|---|
Ereditato: | no |
Animabile: | no. Leggi su animabile |
Versione: | CSS3 |
sintassi JavaScript: | oggetto .style.animationDelay="1s" |
Supporto browser
I numeri nella tabella specificano la prima versione del browser che supporta completamente la proprietà.
I numeri seguiti da -webkit-, -moz- o -o- specificano la prima versione che ha funzionato con un prefisso.
Property | |||||
---|---|---|---|---|---|
animation-delay | 43.0 4.0 -webkit- |
10.0 | 16.0 5.0 -moz- |
9.0 4.0 -webkit- |
30.0 15.0 -webkit- 12.0 -o- |
Sintassi CSS
animation-delay: time|initial|inherit;
Valori di proprietà
Value | Description | Play it |
---|---|---|
time | Optional. Defines the number of seconds (s) or milliseconds (ms) to wait before the animation will start. Default value is 0. Negative values are allowed. If you use negative values, the animation will start as if it had already been playing for N seconds/milliseconds. | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Altri esempi
Esempio
Utilizzo di valori negativi. Qui, l'animazione inizierà come se fosse già stata riprodotta per 2 secondi:
div {
animation-delay: -2s;
}
Pagine correlate
Tutorial CSS: Animazioni CSS
Riferimento HTML DOM: proprietà animationDelay