项目名称 项目描述
animation 创建动画属性。
animation-name:rotation; 规定需要绑定到选择器的 @keyframe 的名称。
animation-duration:3s; 规定完成动画所花费的时间。默认值是 0,意味着没有动画效果。
animation-timing-function:linear; 动画从头到尾的速度是相同的。
animation-iteration-count:infinite; 规定动画应该无限次播放。
animation:rotation 3s linear infinite; 简洁格式,四个参数先后顺序不能变动,执行名为 rotation 的动画规则,时间:3秒完成。
参考资料 http://www.w3school.com.cn/css3/css3_animation.asp
项目名称 项目描述
@keyframes 创建动画规则。
@-moz-keyframes Firefox
@-webkit-keyframes Safari、Chrome
@-o-keyframes Opera
@keyframes rotation{
from{ transform:rotate(0deg); }
to{ transform:rotate(360deg); }
}
定义动画开始:rotation(规则名称)
动画开始规则:from(旋转0度)
动画结束规则:to(旋转360度)
定义动画结束
参考资料 https://www.w3school.com.cn/cssref/pr_keyframes.asp