1.创建动画@keyframes 动画名 {from {} to{}}
2.谁用谁调用 animation: 动画名 执行一遍时间S为单位 执行速度linear匀速 执行次数infinite无限;
如下: 上代码
.div {
//当前元素调用下边定义的动画
adnimation: rotate1 15s linear infinite;
}
//当前动画为原位不动旋转360度
@keyframes rotate1 {
//开始
form {
transform: translate(-50%, -50%) rotate(0deg);
}
//结束
to {
transform: translate(-50%, -50%) rotate(360deg)
}
}
前端学无止境,加油