下面有更多 "亲自试一试" 示例。
这个animation-fill-mode
属性指定动画未播放时(开始前、结束后或两者)时元素的样式。
CSS 动画在播放第一个关键帧之前或播放最后一个关键帧之后不会影响元素。这animation-fill-mode
属性可以覆盖此行为。
表中的数字指定完全支持该属性的第一个浏览器版本。
后跟 -webkit-、-moz- 或 -o- 的数字指定使用前缀的第一个版本。
Property | |||||
---|---|---|---|---|---|
animation-fill-mode | 43.0 4.0 -webkit- |
10.0 | 16.0 5.0 -moz- |
9.0 4.0 -webkit- |
30.0 15.0 -webkit- 12.1 12.0 -o- |
animation-fill-mode: none|forwards|backwards|both|initial|inherit;
Value | Description |
---|---|
none | Default value. Animation will not apply any styles to the element before or after it is executing |
forwards | The element will retain the style values that is set by the last keyframe (depends on animation-direction and animation-iteration-count) |
backwards | The element will get the style values that is set by the first keyframe (depends on animation-direction), and retain this during the animation-delay period |
both | The animation will follow the rules for both forwards and backwards, extending the animation properties in both directions |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
CSS教程:CSS 动画
HTML DOM 参考:动画填充模式属性
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!