Proprietà di animazione CSS
Esempio
Associare un'animazione a un elemento <div>, usando la proprietà shorthand:
div
{
animation: mymove 5s infinite;
}
Definizione e utilizzo
La animation
proprietà è una proprietà abbreviata per:
- nome-animazione
- animazione-durata
- funzione di temporizzazione dell'animazione
- animazione-ritardo
- conteggio delle iterazioni dell'animazione
- animazione-direzione
- modalità di riempimento dell'animazione
- animazione-stato di riproduzione
Nota: specificare sempre la proprietà di durata dell'animazione , altrimenti la durata è 0 e non verrà mai riprodotta.
Valore di default: | nessuno 0 facilità 0 1 normale nessuno in esecuzione |
---|---|
Ereditato: | no |
Animabile: | no. Leggi su animabile |
Versione: | CSS3 |
sintassi JavaScript: | oggetto .style.animation="mymove 5s infinito" |
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 | 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: name duration timing-function delay iteration-count
direction fill-mode play-state;
Valori di proprietà
Value | Description |
---|---|
animation-name | Specifies the name of the keyframe you want to bind to the selector |
animation-duration | Specifies how many seconds or milliseconds an animation takes to complete |
animation-timing-function | Specifies the speed curve of the animation |
animation-delay | Specifies a delay before the animation will start |
animation-iteration-count | Specifies how many times an animation should be played |
animation-direction | Specifies whether or not the animation should play in reverse on alternate cycles |
animation-fill-mode | Specifies what values are applied by the animation outside the time it is executing |
animation-play-state | Specifies whether the animation is running or paused |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Pagine correlate
Tutorial CSS: Animazioni CSS
Riferimento HTML DOM: proprietà di animazione