解释:其属性值是由逗号分开的一个或多个添补形式关键词。
语法
animation-fill-mode : none | forwards | backwards | both;
值 |
形貌 |
none |
不转变默许行动。 |
forwards |
当动画完成后,坚持末了一个属性值(在末了一个关键帧中定义)。 |
backwards |
在 animation-delay 所指定的一段时间内,在动画显现之前,运用最先属性值(在第一个关键帧中定义)。 |
both |
向前和向后添补形式都被运用。 |
实例
为 h1 元素划定添补形式:
<!DOCTYPE html> <html> <head> <style> div { width:100px; height:100px; background:red; animation:myfirst 5s; animation-fill-mode: forwards; -moz-animation:myfirst 5s; /* Firefox */ -webkit-animation:myfirst 5s; /* Safari and Chrome */ -o-animation:myfirst 5s; /* Opera */ } @keyframes myfirst { from {background:red;} to {background:yellow;} } @-moz-keyframes myfirst /* Firefox */ { from {background:red;} to {background:yellow;}
以上就是css animation-fill-mode属性怎样用的细致内容,更多请关注ki4网别的相干文章!