<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>圆环正反向转</title>
<style>
.box{
width: 200px;
height: 200px;
border:100px solid #000;
border-left-color:green;
border-right-color:yellow;
border-bottom-color:red;
margin:100px;
border-radius:50%;
-webkit-animation:circle 6s infinite linear;
animation:circle 6s infinite linear;
}
@-webkit-keyframes circle{
0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}
100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}
/* 下面是反向转 */
/* 100%{transform:rotate(-360deg);} */
}
@keyframes circle{
0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}
100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}
/* 下面是反向转 */
/* 100%{transform:rotate(-360deg);} */
}
.box:hover{
/* 停止动画 */
-webkit-animation-play-state:paused;
animation-play-state:paused;
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>
<html>
<head>
<meta charset="UTF-8" />
<title>圆环正反向转</title>
<style>
.box{
width: 200px;
height: 200px;
border:100px solid #000;
border-left-color:green;
border-right-color:yellow;
border-bottom-color:red;
margin:100px;
border-radius:50%;
-webkit-animation:circle 6s infinite linear;
animation:circle 6s infinite linear;
}
@-webkit-keyframes circle{
0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}
100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}
/* 下面是反向转 */
/* 100%{transform:rotate(-360deg);} */
}
@keyframes circle{
0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}
100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}
/* 下面是反向转 */
/* 100%{transform:rotate(-360deg);} */
}
.box:hover{
/* 停止动画 */
-webkit-animation-play-state:paused;
animation-play-state:paused;
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>