animation-duration

  • Revision slug: CSS/animation-duration
  • Revision title: animation-duration
  • Revision id: 22181
  • Created:
  • Creator: Marcoos
  • Is current revision? No
  • Comment 20 words added, 5 words removed

Revision Content

{{ CSSRef() }}

{{ draft() }}

Summary

The animation-duration CSS property specifies the length of time that an animation should take to complete one cycle.

A value of 0 (the default) indicates that no animation should occur.

It is often convenient to use the shorthand property {{ cssxref("animation") }} to set all animation properties at once.

  • {{ Xref_cssinitial() }}: 0
  • Applies to: block-level and inline-level elements
  • {{ Xref_cssinherited() }}: no
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: as specified

Syntax

animation-duration: <time> [, <time>]*

Values

<time>
The duration that an animation should take to complete one cycle. This may be specified in either seconds (by specifying "s" as the unit) or milliseconds (by specifying "ms" as the unit). If you don't specify a unit, seconds are assumed.
Note: Negative values are treated as 0.

Examples

See CSS animations for examples.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support

{{ CompatVersionUnknown() }}

(as -moz-animation-duration)

{{ CompatGeckoDesktop("5.0") }}

(as -moz-animation-duration)

{{ CompatUnknown() }} {{ CompatUnknown() }}

4.0

(as -webkit-animation-duration)

Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}

Specifications

See also

  • CSS animations
  • {{ domxref("Event/AnimationEvent", "AnimationEvent") }}
  • {{ CSS_Reference:animation() }}

Revision Source

<p>{{ CSSRef() }}</p>
<p>{{ draft() }}</p>
<h3>Summary</h3>
<p>The <code>animation-duration </code>CSS property specifies the length of time that an animation should take to complete one cycle.</p>
<p>A value of 0 (the default) indicates that no animation should occur.</p>
<p>It is often convenient to use the shorthand property {{ cssxref("animation") }} to set all animation properties at once.</p>
<ul> <li>{{ Xref_cssinitial() }}: 0</li> <li>Applies to: block-level and inline-level elements</li> <li>{{ Xref_cssinherited() }}: no</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: as specified</li>
</ul>
<h3>Syntax</h3>
<pre class="eval">animation-duration: &lt;time&gt; [, &lt;time&gt;]*
</pre>
<h3>Values</h3>
<dl> <dt><code>&lt;time&gt;</code></dt> <dd>The duration that an animation should take to complete one cycle. This may be specified in either seconds (by specifying "s" as the unit) or milliseconds (by specifying "ms" as the unit). If you don't specify a unit, seconds are assumed.</dd>
</dl>
<div class="note"><strong>Note:</strong> Negative values are treated as 0.</div>
<h3>Examples</h3>
<p>See <a href="/en/CSS/CSS_animations" title="en/CSS/CSS animations">CSS animations</a> for examples.</p>
<h3 name="Browser_Compatibility">Browser compatibility</h3>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Chrome</th> <th>Firefox (Gecko)</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari (WebKit)</th> </tr> <tr> <td>Basic support</td> <td> <p>{{ CompatVersionUnknown() }}</p> <p>(as <code>-moz-animation-duration</code>)</p> </td> <td> <p>{{ CompatGeckoDesktop("5.0") }}</p> <p>(as <code>-moz-animation-duration</code>)</p> </td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td> <p>4.0</p> <p>(as <code>-webkit-animation-duration</code>)</p> </td> </tr> </tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Android</th> <th>Firefox Mobile (Gecko)</th> <th>IE Phone</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> <td>{{ CompatUnknown() }}</td> </tr> </tbody>
</table>
</div>
<h3>Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/css3-animations" title="http://www.w3.org/TR/css3-animations">CSS Animations Module Level 3</a></li>
</ul>
<h2>See also</h2>
<ul> <li><a href="/en/CSS/CSS_animations" title="en/CSS/CSS animations">CSS animations</a></li> <li>{{ domxref("Event/AnimationEvent", "AnimationEvent") }}</li> <li>{{ CSS_Reference:animation() }}</li>
</ul>
Revert to this revision