英 [??n??me??n]? ?美 [??n??me??n]??

n.生氣,活潑;卡通製作,卡通攝製;[影視]卡通

##n.複數(shù): aniations

css animation屬性 語法

animation屬性怎麼用?

animation屬性是一個簡寫屬性,用於設定六個動畫屬性,基本語法為:animation: name duration timing-function delay iteration-count direction;

#作用:animation 屬性是一個簡寫屬性,用來設定六個動畫屬性。

語法:animation: name duration timing-function delay iteration-count direction;

說明:animation-name ? ?規(guī)定需要綁定定到選擇器的keyframe名稱。? ? ?animation-duration ? ?規(guī)定完成動畫所花費的時間,以秒或毫秒計。? ? animation-timing-function ? ?規(guī)定動畫的速度曲線。? ? animation-delay ? ?規(guī)定在動畫開始之前的延遲。? ? animation-iteration-count ? ?規(guī)定動畫應該播放的次數(shù)。? ? animation-direction ? ?規(guī)定是否應該輪流反向播放動畫。? ??

註解:請一律規(guī)定 animation-duration 屬性,否則長度為 0,就不會播放動畫了。

css animation屬性 範例

<!DOCTYPE html>
<html>
<head>
<style> 
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:mymove 5s infinite;
-webkit-animation:mymove 5s infinite; /*Safari and Chrome*/
}

@keyframes mymove
{
from {left:0px;}
to {left:200px;}
}

@-webkit-keyframes mymove /*Safari and Chrome*/
{
from {left:0px;}
to {left:200px;}
}
</style>
</head>
<body>

<p><strong>注釋:</strong>Internet Explorer 9 以及更早的版本不支持 animation 屬性。</p>

<div></div>

</body>
</html>

執(zhí)行實例 ?

點擊 "執(zhí)行實例" 按鈕查看線上實例