CSS3元素转圈动画(元素旋转动画)<!DOCTYPE html>
<html lang="en">
<head>
<meta chart="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>css 转圈</title>
<style>
.turn{
width:100px;
height: 100px;
background: aqua;
animation:turn 1s linear infinite;
margin: 100px auto;
}
/*
turn : 定义的动画名称
1s : 动画时间
linear : 动画以何种运⾏轨迹完成⼀个周期
infinite :规定动画应该⽆限次播放
*/
@keyframes turn{
0%{-webkit-transform:rotate(0deg);}
25%{-webkit-transform:rotate(90deg);}
50%{-webkit-transform:rotate(180deg);}
75%{-webkit-transform:rotate(270deg);}
100%{-webkit-transform:rotate(360deg);}
}
</style>
</head>
<body>
<div class="turn"></div>
</body>
</html>