CSS3 animation property
Example
Use the shorthand property to bind an animation to a
element:
div
{
animation:
mymove
5
s
infinite
; -
webkit-animation:
mymove
5
s
infinite
;
/*
Safari and Chrome
*/
}
Try it »
Browser support
The numbers in the table indicate the first browser version that supports this property.
A number immediately before -webkit-, -ms-, or -moz- indicates the first browser version that supports that prefixed property.
| 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- |
| Default value: | none 0 ease 0 1 normal |
|---|---|
| Inherited: | no |
| Version: | CSS3 |
| JavaScript syntax: | object.style.animation="mymove 5s infinite" |
Syntax
animation: name duration timing-function delay iteration-count direction fill-mode play-state;
| Value | Description |
|---|---|
| animation-name | Specifies the name of the keyframes to bind to the selector |
| animation-duration | Specifies how many seconds or milliseconds the animation takes to complete |
| animation-timing-function | Sets how the animation will complete a cycle |
| animation-delay | Sets the delay interval before the animation starts. |
| animation-iteration-count | Defines the number of times the animation is played. |
| animation-direction | Specifies whether the animation should be played in reverse on alternate cycles. |
| animation-fill-mode | Specifies the style to apply to the element when the animation is not playing (when it has finished, or when it has a delay and has not yet started). |
| animation-play-state | Specifies whether the animation is running or paused. |
| initial | Sets the property to its default value. Read about initialintroduction. |
| inherit | Inherits the property from the parent element. Read about initinheritalintroduction. |
Related Articles
CSS3 tutorial: CSS3 Animations