效果查看
静态效果
动态效果
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>太极图</title>
<style>
.dayuan{
position: absolute;
border: 1px solid #000000;
width: 400px;
height:400px;
align-items: center;
border-radius:50%;
background:linear-gradient(to bottom,#000000 0%,#000000 50%,#FFFFFF 51%,#FFFFFF 100%);
animation: dayuan 8s linear infinite;
}
@keyframes dayuan{
0%{
transform: rotate(0deg);
}
100%{
transform: rotate(-360deg);
}
}
.xiao1{
position: relative;
width: 200px;
height:200px;
border-radius: 50%;
margin-top: 25%;
background-color: #FFFFFF;
}
.xiao2{
position: relative;
width: 200px;
height:200px;
border-radius:50%;
margin-top: -50%;
margin-left: 50%;
background-color: black;
}
.xin1{
position: relative;
width: 50px;
height: 50px;
border-radius: 50%;
margin-top: -30%;
margin-left: 75px;
background-color: black;
}
.xin2{
position: relative;
width: 50px;
height: 50px;
border-radius: 50%;
margin-top: -50px;
margin-left: 280px;
background-color: #FFFFFF;
}
</style>
</head>
<body>
<div class="dayuan">
<div class="xiao1"></div>
<div class="xiao2"></div>
<div class="xin1"></div>
<div class="xin2"></div>
</div>
</body>
</html>