none, backwards, both 这三个的结果没区别啊,运行完后都跳回初始状态的红色了,有什么区别吗???
蚊子漫布
2014-09-05
1 回答
三者是有区别的,具体的区别都描述的非常清楚。只是你还没有通过实例理解透。建议使用下面的代码做个测试理解:
@keyframes redToBlue{
from{
background: red;
}
20%{
background:green;
}
40%{
background:lime;
}
60%{
background:yellow;
}
to{
background:blue;
}
}
div {
width: 200px;
height: 200px;
background: red;
margin: 20px auto;
animation-name:redToBlue;
animation-duration: 20s;
animation-timing-function: ease;
animation-delay: 1s;
animation-fill-mode: backwards;
}
举报
0/150
提交
取消