animation

英 [??n??me??n]? ?美 [??n??me??n]??

n.生氣,活潑;動(dòng)畫(huà)片制作,動(dòng)畫(huà)片攝制;[影視]動(dòng)畫(huà)片

復(fù)數(shù): animations

fill

英 [f?l]? ?美 [f?l]??

vt.& vi.(使)充滿(mǎn),(使)裝滿(mǎn)

vt.滿(mǎn)足;配藥;(按訂單)供應(yīng);使充滿(mǎn)(感情)

n.填滿(mǎn)…的量;充分;裝填物;路堤

第三人稱(chēng)單數(shù): fills 復(fù)數(shù): fills 現(xiàn)在分詞: filling 過(guò)去式: filled 過(guò)去分詞: filled

mode

英 [m??d]? ?美 [mo?d]??

n.方式;狀況;時(shí)尚,風(fēng)尚;調(diào)式

復(fù)數(shù): modes

css animation-fill-mode屬性 語(yǔ)法

animation-fill-mode是什么意思?

animation-fill-mode是CSS的一個(gè)動(dòng)畫(huà)屬性,用來(lái)規(guī)定動(dòng)畫(huà)在播放之前或之后,其動(dòng)畫(huà)效果是否可見(jiàn)。

作用:animation-fill-mode 屬性規(guī)定動(dòng)畫(huà)在播放之前或之后,其動(dòng)畫(huà)效果是否可見(jiàn)。

語(yǔ)法:animation-fill-mode : none | forwards | backwards | both;

說(shuō)明:none ? ?不改變默認(rèn)行為。? ? forwards ? ?當(dāng)動(dòng)畫(huà)完成后,保持最后一個(gè)屬性值(在最后一個(gè)關(guān)鍵幀中定義)。? ? backwards ? ?在 animation-delay 所指定的一段時(shí)間內(nèi),在動(dòng)畫(huà)顯示之前,應(yīng)用開(kāi)始屬性值(在第一個(gè)關(guān)鍵幀中定義)。? ? both ? ?向前和向后填充模式都被應(yīng)用。? ??

注釋?zhuān)?/strong>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í)例" 按鈕查看在線(xiàn)實(shí)例