animation
英[??n??me??n]? ?美[??n??me??n]??
n.生氣,活潑;卡通製作,卡通攝製;[影視]卡通片
複數(shù): animations
duration
英[dju?re??n]? ?美[du?re??n]??
n.持續(xù),持續(xù)的時間,期間期間;(時間的)持續(xù),持久,連續(xù);[語音學(xué)]音長,音延
複數(shù): durations
CSS 動畫持續(xù)時間屬性 語法
animation-duration屬性怎麼用?
animation-duration屬性是用來定義動畫完成一個週期所需的時間,以秒或毫秒計(jì);基本語法為animation-duration: time。
作用:animation-duration 屬性定義動畫完成一個週期所需的時間,以秒或毫秒計(jì)。
語法:animation-duration: time
#說明:time ? ?規(guī)定完成動畫所花費(fèi)的時間。預(yù)設(shè)值是 0,意味著沒有動畫效果。? ??
註解:Internet Explorer 9 以及更早的版本不支援 animation-duration 屬性。
CSS 動畫持續(xù)時間屬性 範(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 屬性,否則時長為 0,就不會播放動畫了。</p> </body> </html>
執(zhí)行實(shí)例 ?
點(diǎn)擊 "執(zhí)行實(shí)例" 按鈕查看線上實(shí)例