animation
英[??n??me??n]? ?美[??n??me??n]??
n.生氣,活潑;卡通製作,卡通攝製;[影視]卡通片
複數(shù): animations
fill
英[f?l]? ?美[f?l]??
#vt.& vi.(使)充滿,(使)裝滿
vt.滿足;配藥;(按訂單)供應(yīng);使充滿(感情)
n.填滿…的量;充分;裝填物;路堤
第三人稱單數(shù): fills 複數(shù): fills 現(xiàn)在分詞: filling 過去式: filled 過去分詞: filled
mode
#英[m??d]? ?美[ mo?d]??
n.方式;狀況;時尚,風(fēng)尚;調(diào)式
複數(shù): modes
CSS 動畫填滿模式屬性 語法
animation-fill-mode是什麼意思?
animation-fill-mode是CSS的動畫屬性,用來規(guī)定動畫在播放之前或之後,其動畫效果是否可見。
作用:animation-fill-mode 屬性規(guī)定動畫在播放之前或之後,其動畫效果是否可見。
語法:animation-fill-mode : none | forwards | backwards | both;
說明:none ? ?不改變預(yù)設(shè)行為。? ? forwards ? ?當(dāng)動畫完成後,保持最後一個屬性值(在最後一個關(guān)鍵影格中定義)。? ? backwards ? ?在 animation-delay 所指定的一段時間內(nèi),在動畫顯示之前,套用開始屬性值(在第一個關(guān)鍵影格中定義)。? ? both ? ?向前和向後填滿模式都被應(yīng)用。? ??
註解:Internet Explorer 9 以及更早的版本不支援 animation-fill-mode 屬性。
CSS 動畫填滿模式屬性 範(fàn)例
<!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>
執(zhí)行實例 ?
點擊 "執(zhí)行實例" 按鈕查看線上實例