英 [??n??me??n]? ?美 [??n??me??n]??
n.生氣,活潑;卡通製作,卡通攝製;[影視]卡通
##n.複數(shù): aniations
css animation屬性 語法
animation屬性怎麼用?
animation屬性是一個(gè)簡寫屬性,用於設(shè)定六個(gè)動(dòng)畫屬性,基本語法為:animation: name duration timing-function delay iteration-count direction;
#作用:animation 屬性是一個(gè)簡寫屬性,用來設(shè)定六個(gè)動(dòng)畫屬性。
語法:animation: name duration timing-function delay iteration-count direction;
說明:animation-name ? ?規(guī)定需要綁定定到選擇器的keyframe名稱。? ? ?animation-duration ? ?規(guī)定完成動(dòng)畫所花費(fèi)的時(shí)間,以秒或毫秒計(jì)。? ? animation-timing-function ? ?規(guī)定動(dòng)畫的速度曲線。? ? animation-delay ? ?規(guī)定在動(dòng)畫開始之前的延遲。? ? animation-iteration-count ? ?規(guī)定動(dòng)畫應(yīng)該播放的次數(shù)。? ? animation-direction ? ?規(guī)定是否應(yīng)該輪流反向播放動(dòng)畫。? ??
註解:請(qǐng)一律規(guī)定 animation-duration 屬性,否則長度為 0,就不會(huì)播放動(dòng)畫了。
css animation屬性 範(fàn)例
<!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í)行實(shí)例 ?
點(diǎn)擊 "執(zhí)行實(shí)例" 按鈕查看線上實(shí)例