animation

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

n.生氣,活潑;動(dòng)畫片制作,動(dòng)畫片攝制;[影視]動(dòng)畫片

復(fù)數(shù): animations

duration

英 [dju?re??n]? ?美 [du?re??n]??

n.持續(xù),持續(xù)的時(shí)間,期間;(時(shí)間的)持續(xù),持久,連續(xù);[語音學(xué)]音長(zhǎng),音延

復(fù)數(shù): durations

css animation-duration屬性 語法

animation-duration屬性怎么用?

animation-duration屬性是用來定義動(dòng)畫完成一個(gè)周期所需要的時(shí)間,以秒或毫秒計(jì);基本語法為animation-duration: time。

作用:animation-duration 屬性定義動(dòng)畫完成一個(gè)周期所需要的時(shí)間,以秒或毫秒計(jì)。

語法:animation-duration: time

說明:time ? ?規(guī)定完成動(dòng)畫所花費(fèi)的時(shí)間。默認(rèn)值是 0,意味著沒有動(dòng)畫效果。? ??

注釋:Internet Explorer 9 以及更早的版本不支持 animation-duration 屬性。

css animation-duration屬性 示例

<!DOCTYPE html>
<html>
<head>
<style> 
div
{
width:100px;
height:100px;
background:red;
position:relative;
animation:mymove infinite;
animation-duration:2s;

/* Safari and Chrome */
-webkit-animation:mymove infinite;
-webkit-animation-duration:2s;
}

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

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

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

<div></div>

<p><b>注釋:</b>始終規(guī)定 animation-duration 屬性,否則時(shí)長(zhǎng)為 0,就不會(huì)播放動(dòng)畫了。</p>

</body>
</html>

運(yùn)行實(shí)例 ?

點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例