animation
英 [??n??me??n]? ?美 [??n??me??n]??
n.生氣,活潑;動(dòng)畫片制作,動(dòng)畫片攝制;[影視]動(dòng)畫片
復(fù)數(shù): animations
fill
英 [f?l]? ?美 [f?l]??
vt.& vi.(使)充滿,(使)裝滿
vt.滿足;配藥;(按訂單)供應(yīng);使充滿(感情)
n.填滿…的量;充分;裝填物;路堤
第三人稱單數(shù): fills 復(fù)數(shù): fills 現(xiàn)在分詞: filling 過去式: filled 過去分詞: filled
mode
英 [m??d]? ?美 [mo?d]??
n.方式;狀況;時(shí)尚,風(fēng)尚;調(diào)式
復(fù)數(shù): modes
css animation-fill-mode屬性 語法
animation-fill-mode是什么意思?
animation-fill-mode是CSS的一個(gè)動(dòng)畫屬性,用來規(guī)定動(dòng)畫在播放之前或之后,其動(dòng)畫效果是否可見。
作用:animation-fill-mode 屬性規(guī)定動(dòng)畫在播放之前或之后,其動(dòng)畫效果是否可見。
語法:animation-fill-mode : none | forwards | backwards | both;
說明:none ? ?不改變默認(rèn)行為。? ? forwards ? ?當(dāng)動(dòng)畫完成后,保持最后一個(gè)屬性值(在最后一個(gè)關(guān)鍵幀中定義)。? ? backwards ? ?在 animation-delay 所指定的一段時(shí)間內(nèi),在動(dòng)畫顯示之前,應(yīng)用開始屬性值(在第一個(gè)關(guān)鍵幀中定義)。? ? both ? ?向前和向后填充模式都被應(yīng)用。? ??
注釋:Internet Explorer 9 以及更早的版本不支持 animation-fill-mode 屬性。
css animation-fill-mode屬性 示例
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <style> div { width:100px; height:100px; background:red; position:relative; animation:mymove 3s; animation-iteration-count:2; animation-fill-mode:forwards; /* Safari 和 Chrome */ -webkit-animation:mymove 3s; -webkit-animation-iteration-count:2; -webkit-animation-fill-mode:forwards; } @keyframes mymove { from {top:0px;} to {top:200px;} } @-webkit-keyframes mymove /* Safari 和 Chrome */ { from {top:0px;} to {top:200px;} } </style> </head> <body> <p><strong>注意:</strong>Internet Explorer 9 及其之前的版本不支持 animation-fill-mode 屬性。</p> <div></div> </body> </html>
運(yùn)行實(shí)例 ?
點(diǎn)擊 "運(yùn)行實(shí)例" 按鈕查看在線實(shí)例