亚洲区国产区激情区无码区,国产成人mv视频在线观看,国产A毛片AAAAAA,亚洲精品国产首次亮相在线

CSS 參考手冊(cè)

CSS @規(guī)則(RULES)

CSS 屬性大全

CSS3 animation-fill-mode 屬性使用方法及示例

CSS3 animation-fill-mode屬性指定CSS動(dòng)畫在執(zhí)行之前和之后,如何將樣式應(yīng)用于其目標(biāo)。

下表總結(jié)了此屬性的用法上下文和版本歷史記錄。

默認(rèn)值:none
適用于:所有元素::before和::after 偽元素
繼承:沒有
可動(dòng)畫制作:否。請(qǐng)參見 動(dòng)畫屬性
版本: CSS3的新功能
JavaScript 語(yǔ)法:    object.style.animationFillMode="forwards"

animation-fill-mode的使用語(yǔ)法

該屬性的語(yǔ)法如下:

animation-fill-mode: none | forwards | backwards | both | initial | inherit

下面的示例演示了如何使用animation-fill-mode屬性。

.box {
    width: 50px;
    height: 50px;
    background: red;
    position: relative;
    /* Chrome, Safari, Opera */
    -webkit-animation-name: moveit;
    -webkit-animation-duration: 4s;
    -webkit-animation-fill-mode: forwards;
    
    animation-name: moveit;
    animation-duration: 4s;
    animation-fill-mode: forwards;
}
 
/* Chrome, Safari, Opera */
@-webkit-keyframes moveit {
    from {left: 0;}
    to {left: 50%;}
}
 

@keyframes moveit {
    from {left: 0;}
    to {left: 50%;}
}
測(cè)試看看?/?

屬性值

下表描述了此屬性的值。

描述
none動(dòng)畫在執(zhí)行之前或之后不會(huì)對(duì)目標(biāo)應(yīng)用任何樣式。
forwards動(dòng)畫結(jié)束后(由決定animation-iteration-count),動(dòng)畫將在動(dòng)畫結(jié)束時(shí)應(yīng)用屬性值。
backwards動(dòng)畫將應(yīng)用在關(guān)鍵幀中定義的屬性值,該關(guān)鍵幀將由animation-delay屬性定義的時(shí)間段內(nèi)開始動(dòng)畫的第一次迭代。這些是from關(guān)鍵幀的值(animation-direction為normal或時(shí)alternate)或to關(guān)鍵幀的值(animation-direction為reverse或時(shí)alternate-reverse)。
both動(dòng)畫將遵循向前和向后的規(guī)則,從而在兩個(gè)方向上擴(kuò)展了動(dòng)畫屬性。
initial將此屬性設(shè)置為其默認(rèn)值。
inherit如果指定,則關(guān)聯(lián)元素采用其父元素animation-fill-mode屬性的計(jì)算值。

瀏覽器兼容性

animation-fill-mode屬性瀏覽器的兼容性,所有主流瀏覽器均支持該屬性。

瀏覽器圖標(biāo)
  • Firefox 5+ -moz-,15 +

  • Google Chrome 4+ -webkit-

  • Internet Explorer 10+

  • Apple Safari 4+ -webkit-

  • Opera 12+ -o-,15+ -webkit-

進(jìn)一步閱讀

請(qǐng)參考以下教程:CSS3動(dòng)畫。

相關(guān)屬性和規(guī)則:   animation,animation-nameanimation-duration,animation-timing-function,animation-delay,animation-iteration-countanimation-direction,animation-play-state,@keyframes。