<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="Width = device - width, initial - scale = 1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>The CSS in circles</title>
<style>
.turn{
position: relative;
width:100px;
height: 100px;
border: 10px solid #f4f4f4;
animation:turn 1s linear infinite;
margin: 100px auto;
border-radius: 50%;
}
.turn::after{
position: absolute;
content: ' ';
top:0px;
left:10px;
width: 12px;
height: 12px;
background: # 333;
border-radius:50%;
}
.turn::before{
position: absolute;
content: ' ';
top: -4px;
left:16px;
width: 12px;
height: 12px;
background: blue;
border-radius:50%;
}
/* turn: the name of the defined animation 1s: the animation time linear: the animation trajectory to complete a cycle infinite: specifies that the animation should play an infinite number of times */
@keyframes turn{
0%{transform:rotate(0deg); 25%} {transform:rotate(90deg); 50%} {transform:rotate(180deg); 75%} {transform:rotate(270deg); 100%} {transform:rotate(360deg);}
}
</style>
</head>
<body>
<div class="turn">
</div>
</body>
</html>
Copy the code