CSS - Animationseigenschaft
Beispiel
Binden einer Animation an ein <div>-Element mithilfe der Kurzschrifteigenschaft:
div
{
animation: mymove 5s infinite;
}
Definition und Verwendung
Die animation
Eigenschaft ist eine abgekürzte Eigenschaft für:
- Animationsname
- Animationsdauer
- Animation-Timing-Funktion
- Animationsverzögerung
- Anzahl der Animations-Iterationen
- Animations-Regie
- Animationsfüllmodus
- Animation-Play-State
Hinweis: Geben Sie immer die Eigenschaft animation-duration an, andernfalls ist die Dauer 0 und wird nie abgespielt.
Standardwert: | keine 0 leicht 0 1 normal keine läuft |
---|---|
Vererbt: | Nein |
Animierbar: | Nein. Lesen Sie mehr über animierbare |
Ausführung: | CSS3 |
JavaScript-Syntax: | object .style.animation="mymove 5s unendlich" |
Browser-Unterstützung
Die Zahlen in der Tabelle geben die erste Browserversion an, die die Eigenschaft vollständig unterstützt.
Zahlen gefolgt von -webkit-, -moz- oder -o- geben die erste Version an, die mit einem Präfix funktioniert hat.
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- |
CSS-Syntax
animation: name duration timing-function delay iteration-count
direction fill-mode play-state;
Eigenschaftswerte
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 |
Verwandte Seiten
CSS-Tutorial: CSS-Animationen
HTML-DOM-Referenz: Animationseigenschaft