您好,欢迎访问一九零五行业门户网

设置动画未播放时元素的 CSS 样式

使用animation-fill-mode属性设置动画未播放时元素的样式
示例现场演示
<!doctype html><html> <head> <style> div { width: 150px; height: 200px; position: relative; background: red; animation-name: myanim; animation-duration: 2s; animation-fill-mode: backwards; } @keyframes myanim { from {left: 0px; background-color: green;} to {left: 200px; background-color: blue;} } </style> </head> <body> <div></div> </body></html>
以上就是设置动画未播放时元素的 css 样式的详细内容。
其它类似信息

推荐信息