O'Reilly logo

CSS Pocket Reference, 4th Edition by Eric A. Meyer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

animation-duration

Values:

<time> [, <time>]*

Initial value:

0ms

Applies to:

Block-level and inline-level elements

Inherited:

No

Computed value:

Same as declared value

Description:

Defines the length of time it should take for each cycle of a CSS animation to run from start to finish. Therefore, in animations with only one cycle, it defines the total time of the animation. The default value, 0ms, means that there will be no animation besides moving the element from its start state to its end state. Negative values are converted to 0ms.

Examples:

h1 {animation-duration: 10s, 5s, 2.5s, 1250ms;}
.zip {animation-duration: 90ms;}

Note:

As of mid-2011, the actual default value in the specification is 0. It is given as 0ms here for clarity’s sake, as only length values and numbers are permitted unitless zeroes.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required