HTMLクイックリファレンス


トップページへ
HTMLタグ(目的別) CSSプロパティ(目的別) WEBカラー WEB画像
HTMLタグ(ABC順) CSSプロパティ(ABC順) 優良デザイン 特殊文字
HTML5 CSS3 JavaScript HTML5 API
HTMLの基本 CSSの基本 Canvas サイトマップ

トップページ  > CSS3  > animation-duration

★CSS3リファレンス

animation-duration …… アニメーション一回分の時間の長さを指定する
Google Chrome2(-webkit-)Google Chrome3(-webkit-)Google Chrome4(-webkit-)Google Chrome5(-webkit-)Google Chrome6(-webkit-) Safari4(-webkit-)Safari5(-webkit-)

animation-durationプロパティは、要素にキーフレームアニメーションを適用する場合の、 アニメーション一回分の時間の長さを指定する際に使用します。

animation-durationプロパティの値には、時間を指定します。 初期値は0ですが、この場合にはアニメーションは実行されません。 負の値を指定すると、0として扱われます。

■値

時間
時間を指定する(例:5秒なら5s)(初期値は0)

■適用対象・値の継承・初期値

初期値
0
適用対象
ブロックレベル要素、インライン要素
値の継承
しない

■使用例

スタイルシート部分は外部ファイル(sample.css)に記述。

div.sample {
animation-name: 'anime1';
animation-duration: 5s;
animation-timing-function: ease;
animation-iteration-count: infinite;
}

@keyframes 'anime1' {
0% {width: 50px; height: 50px; background-color: aqua;}
100% {width: 200px; height: 50px; background-color: blue;}
}

HTMLソース

<html>
<head>
<link rel="stylesheet" href="sample.css" type="text/css">
</head>
<body>
<div class="sample">animation効果のサンプル</div>
</body>
</html>
↓↓↓

ブラウザ上の表示

animation効果のサンプル

■ベンダープレフィックスを付けた場合の使用例

スタイルシート部分は外部ファイル(sample.css)に記述。

div.prefix_sample {
-moz-animation-name: 'anime1';
-moz-animation-duration: 5s;
-moz-animation-timing-function: ease;
-moz-animation-iteration-count: infinite;

-webkit-animation-name: 'anime1';
-webkit-animation-duration: 5s;
-webkit-animation-timing-function: ease;
-webkit-animation-iteration-count: infinite;

-o-animation-name: 'anime1';
-o-animation-duration: 5s;
-o-animation-timing-function: ease;
-o-animation-iteration-count: infinite;

-ms-animation-name: 'anime1';
-ms-animation-duration: 5s;
-ms-animation-timing-function: ease;
-ms-animation-iteration-count: infinite;
}

@-moz-keyframes 'anime1' {
0% {width: 50px; height: 50px; background-color: aqua;}
100% {width: 200px; height: 50px; background-color: blue;}
}

@-webkit-keyframes 'anime1' {
0% {width: 50px; height: 50px; background-color: aqua;}
100% {width: 200px; height: 50px; background-color: blue;}
}

@-o-keyframes 'anime1' {
0% {width: 50px; height: 50px; background-color: aqua;}
100% {width: 200px; height: 50px; background-color: blue;}
}

@-ms-keyframes 'anime1' {
0% {width: 50px; height: 50px; background-color: aqua;}
100% {width: 200px; height: 50px; background-color: blue;}
}

HTMLソース

<html>
<head>
<link rel="stylesheet" href="sample.css" type="text/css">
</head>
<body>
<div class="prefix_sample">animation効果のサンプル</div>
</body>
</html>
↓↓↓

ブラウザ上の表示

animation効果のサンプル

トップページ  > CSS3  > animation-duration

HTMLクイックリファレンス


トップページへ
HTMLタグ(目的別) CSSプロパティ(目的別) WEBカラー WEB画像
HTMLタグ(ABC順) CSSプロパティ(ABC順) 優良デザイン 特殊文字
HTML5 CSS3 JavaScript HTML5 API
HTMLの基本 CSSの基本 Canvas サイトマップ
MuuMuu Domain!
ドメイン取るならお名前.com
さくらのレンタルサーバ
ロリポップ!レンタルサーバー
『激安ドメイン&レンタルサーバー』☆ロケットネット☆
HTMLクイックリファレンスについて
このウェブサイトが本になりました
©2012 HTMQ