效果图:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>太极图</title>
<link rel="stylesheet" href="./css/太极图.css">
</head>
<body>
<div>
<section class="left"></section>
<section class="right"></section>
</div>
</body>
</html>
div{ width: 200px;
height: 100px;
border: 1px solid black;
border-radius: 50%;
margin: 200px auto;
border-bottom-width: 100px;
animation: taijitu 3s infinite alternate;
}
.left{
width: 20px;
height: 20px;
border-radius: 50%;
border: 40px solid black;
margin-top: 50px;
background-color: white;
}
.right{
width: 20px;
height: 20px;
border-radius: 50%;
border: 40px solid white;
margin-left: 100px;
margin-top: -100px;
background-color: black;
}
@keyframes taijitu{
from{
transform: rotate(0deg);;
}
to{
transform: rotate(360deg);
}
}