亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

CSS3アニメーション

CSS3 アニメーション

CSS3 アニメーション

CSS3 では、多くの Web ページのアニメーション畫像、Flash アニメーション、JAVAScript を置き換えることができるアニメーションを作成できます。

CSS3 @keyframes ルール

CSS3 アニメーションを作成するには、@keyframes ルールを理解する必要があります。

@keyframes ルールはアニメーションを作成するためのものです。 @keyframes ルール內(nèi)で CSS スタイルとアニメーションを指定し、現(xiàn)在のスタイルから新しいスタイルに徐々に変更します。


CSS3 アニメーション

@keyframes でアニメーションを作成するときは、それをセレクターにバインドします。そうしないと、アニメーションは効果がありません。

セレクターにバインドする少なくとも 2 つの CSS3 アニメーション プロパティを指定します:

アニメーションの名前を指定します

アニメーションの継続時(shí)間を指定します

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">  
<style> 
div
{
width:100px;
height:100px;
background:red;
animation:myfirst 5s;
-webkit-animation:myfirst 5s; /* Safari and Chrome */
}
@keyframes myfirst
{
from {background:red;}
to {background:yellow;}
}


CSS3 アニメーション プロパティ

次の表に、@keyframes ルールとすべてのアニメーションプロパティ:

@keyframes。 3

Animation-Play-State 屬性を除く、すべてのアニメーション屬性の省略されたアニメーションの屬性。 3

animation-name は @keyframes アニメーションの名前を指定します。 ;デフォルトは 0 です。 3

animation-timing-function はアニメーションの速度カーブを指定します。デフォルトは「簡(jiǎn)単」です。 3

animation-delay は、アニメーションの開始時(shí)期を指定します。デフォルトは 0 です。 ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????デフォルトは 1 です。 3

animation-direction は、次のサイクルでアニメーションを逆再生するかどうかを指定します。デフォルトは「通?!工扦埂?3

animation-play-state は、アニメーションが実行中か一時(shí)停止中かを指定します。デフォルトは「実行中」です。 3

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"> 
<style> 
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:myfirst 5s linear 2s infinite alternate;
/* Firefox: */
-moz-animation:myfirst 5s linear 2s infinite alternate;
/* Safari and Chrome: */
-webkit-animation:myfirst 5s linear 2s infinite alternate;
/* Opera: */
-o-animation:myfirst 5s linear 2s infinite alternate;
}
@keyframes myfirst
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
@-moz-keyframes myfirst /* Firefox */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
@-webkit-keyframes myfirst /* Safari and Chrome */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
@-o-keyframes myfirst /* Opera */
{
0%   {background:red; left:0px; top:0px;}
25%  {background:yellow; left:200px; top:0px;}
50%  {background:blue; left:200px; top:200px;}
75%  {background:green; left:0px; top:200px;}
100% {background:red; left:0px; top:0px;}
}
</style>
</head>
<body>
<p><b>注意:</b> 該實(shí)例在 Internet Explorer 9 及更早 IE 版本是無效的。</p>
<div></div>
</body>
</html>
rree

CSS3アニメーションとは何ですか?

アニメーションは、要素をあるスタイルから別のスタイルに徐々に変更する効果です。


スタイルは何度でも好きなだけ変更できます。

変更が発生する時(shí)間を指定するにはパーセンテージを使用するか、0% と 100% に相當(dāng)するキーワード「from」と「to」を使用してください。

0% はアニメーションの開始、100% はアニメーションの完了です。

ブラウザのサポートを最適化するには、常に 0% および 100% セレクターを定義する必要があります。

りー

學(xué)び続ける
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <style> div { width:100px; height:100px; background:red; animation:myfirst 5s; -moz-animation:myfirst 5s; /* Firefox */ -webkit-animation:myfirst 5s; /* Safari and Chrome */ -o-animation:myfirst 5s; /* Opera */ } @keyframes myfirst { 0% {background:red;} 25% {background:yellow;} 50% {background:blue;} 100% {background:green;} } @-moz-keyframes myfirst /* Firefox */ { 0% {background:red;} 25% {background:yellow;} 50% {background:blue;} 100% {background:green;} } @-webkit-keyframes myfirst /* Safari and Chrome */ { 0% {background:red;} 25% {background:yellow;} 50% {background:blue;} 100% {background:green;} } @-o-keyframes myfirst /* Opera */ { 0% {background:red;} 25% {background:yellow;} 50% {background:blue;} 100% {background:green;} } </style> </head> <body> <div></div> <p><b>注釋:</b>當(dāng)動(dòng)畫完成時(shí),會(huì)變回初始的樣式。</p> <p><b>注意:</b> 該實(shí)例在 Internet Explorer 9 及更早 IE 版本是無效的。</p> </body> </html>
提出するリセットコード