--- title: animation-duration slug: Web/CSS/animation-duration tags: - Animation - CSS - CSS アニメーション - CSS プロパティ - Reference - animation-duration translation_of: Web/CSS/animation-duration --- <div>{{CSSRef}}</div> <p><strong><code>animation-duration</code></strong> は <a href="/ja/docs/CSS">CSS</a> のプロパティで、1回のアニメーション周期が完了するまでの所要時間を設定します。</p> <div>{{EmbedInteractiveExample("pages/css/animation-duration.html")}}</div> <p class="hidden">このデモのソースファイルは GitHub リポジトリに格納されています。デモプロジェクトに協力したい場合は、 <a href="https://github.com/mdn/interactive-examples">https://github.com/mdn/interactive-examples</a> をクローンしてプルリクエストを送信してください。</p> <p>アニメーションのプロパティすべてを一度に設定するには、一括指定プロパティである {{cssxref("animation")}} プロパティを使用すると便利です。</p> <h2 id="Syntax" name="Syntax">構文</h2> <pre class="brush:css no-line-numbers notranslate">/* 単一のアニメーション */ animation-duration: 6s; animation-duration: 120ms; /* 複数のアニメーション */ animation-duration: 1.64s, 15.22s; animation-duration: 10s, 35s, 230ms; </pre> <h3 id="Values" name="Values">値</h3> <dl> <dt><code>{{cssxref("<time>")}}</code></dt> <dd>1回のアニメーションの周期にかかる時間。この値は、秒 (<code>s</code>) またはミリ秒 (<code>ms</code>) で指定することができます。値は正の数か0でなければならず、単位は必須です。 <code>0s</code> の値は、既定値ですが、アニメーションを実行しないことを意味します。</dd> </dl> <div class="note"> <p><strong>注:</strong> 負の数は無効であり、宣言が無視されます。一部、初期の接頭辞付きの実装は <code>0s</code> と等価に解釈するかもしれません。</p> </div> <div class="note"> <p><strong>注</strong>: <code>animation-*</code> プロパティにカンマ区切りで複数の値を指定した場合、 {{cssxref("animation-name")}} プロパティで指定したアニメーションに割り当てられますが、いくつあるかによって異なる方法で割り当てられます。詳しくは、<a href="/ja/docs/Web/CSS/CSS_Animations/Using_CSS_animations#Setting_multiple_animation_property_values">複数のアニメーションプロパティ値の設定</a> を参照してください。</p> </div> <h2 id="Formal_definition" name="Formal_definition">公式定義</h2> <p>{{cssinfo}}</p> <h2 id="Formal_syntax" name="Formal_syntax">形式文法</h2> <pre class="syntaxbox notranslate">{{csssyntax}}</pre> <h2 id="Examples" name="Examples">例</h2> <p><a href="/ja/docs/Web/CSS/CSS_Animations/Using_CSS_animations">CSS アニメーション</a>を参照してください。</p> <h2 id="Specifications" name="Specifications">仕様書</h2> <table class="standard-table"> <thead> <tr> <th scope="col">仕様書</th> <th scope="col">状態</th> <th scope="col">備考</th> </tr> </thead> <tbody> <tr> <td>{{SpecName('CSS3 Animations', '#animation-duration', 'animation-duration')}}</td> <td>{{Spec2('CSS3 Animations')}}</td> <td>初回定義</td> </tr> </tbody> </table> <h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> <div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div> <p>{{Compat("css.properties.animation-duration")}}</p> <h2 id="See_also" name="See_also">関連情報</h2> <ul> <li><a href="/ja/docs/Web/CSS/CSS_Animations/Using_CSS_animations" title="Tutorial about CSS animations">CSS アニメーションの使用</a></li> <li>JavaScript {{domxref("AnimationEvent")}} API</li> </ul>