animation
英[??n??me??n]? ?美[??n??me??n]??
n.生氣,活潑;卡通製作,卡通攝製;[影視]卡通片
複數(shù): animations
duration
英[dju?re??n]? ?美[du?re??n]??
n.持續(xù),持續(xù)的時(shí)間,期間期間;(時(shí)間的)持續(xù),持久,連續(xù);[語(yǔ)音學(xué)]音長(zhǎng),音延
複數(shù): durations
CSS3動(dòng)畫持續(xù)時(shí)間屬性 語(yǔ)法
作用:animation-duration 屬性定義動(dòng)畫完成一個(gè)週期所需的時(shí)間,以秒或毫秒計(jì)。
語(yǔ)法:animation-duration: time
#說(shuō)明:time ? ?規(guī)定完成動(dòng)畫所花費(fèi)的時(shí)間。預(yù)設(shè)值是 0,意味著沒(méi)有動(dòng)畫效果。? ??
註解:Internet Explorer 9 以及更早的版本不支援 animation-duration 屬性。
設(shè)定完成動(dòng)畫所花費(fèi)的時(shí)間可以透過(guò)CSS3中animation-duration屬性來(lái)設(shè)定。以秒或毫秒為單位,它的預(yù)設(shè)值為0,表示無(wú)動(dòng)畫效果
CSS3動(dòng)畫持續(xù)時(shí)間屬性 範(fàn)例
<!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>
執(zhí)行實(shí)例 ?
點(diǎn)擊 "執(zhí)行實(shí)例" 按鈕查看線上實(shí)例