久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      css3怎么實現(xiàn)動畫結(jié)束不消失效果

      css3中,可利用“animation-fill-mode”屬性實現(xiàn)動畫結(jié)束不消失效果,該屬性可規(guī)定動畫不播放時元素的樣式,當屬性設置為forwards時,動畫效果不消失,語法為“animation-fill-mode:forwards”。

      css3怎么實現(xiàn)動畫結(jié)束不消失效果

      本教程操作環(huán)境:windows10系統(tǒng)、CSS3&&HTML5版、Dell G3電腦。

      css3怎么實現(xiàn)動畫結(jié)束不消失效果

      animation-fill-mode 屬性規(guī)定當動畫不播放時(當動畫完成時,或當動畫有一個延遲未開始播放時),要應用到元素的樣式。

      默認情況下,CSS 動畫在第一個關(guān)鍵幀播放完之前不會影響元素,在最后一個關(guān)鍵幀完成后停止影響元素。animation-fill-mode 屬性可重寫該行為。

      CSS 語法

      animation-fill-mode: none|forwards|backwards|both|initial|inherit;
      • none 默認值。動畫在動畫執(zhí)行之前和之后不會應用任何樣式到目標元素。

      • forwards 在動畫結(jié)束后(由 animation-iteration-count 決定),動畫將應用該屬性值。

      • backwards 動畫將應用在 animation-delay 定義期間啟動動畫的第一次迭代的關(guān)鍵幀中定義的屬性值。這些都是 from 關(guān)鍵幀中的值(當 animation-direction 為 "normal" 或 "alternate" 時)或 to 關(guān)鍵幀中的值(當 animation-direction 為 "reverse" 或 "alternate-reverse" 時)。

      • both 動畫遵循 forwards 和 backwards 的規(guī)則。也就是說,動畫會在兩個方向上擴展動畫屬性。

      • initial 設置該屬性為它的默認值。

      • inherit 從父元素繼承該屬性。

      示例如下:

      <html> <head> <meta charset="utf-8">  <title>123</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>

      輸出結(jié)果:

      css3怎么實現(xiàn)動畫結(jié)束不消失效果

      (學習視頻分享:css視頻教程)

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號