HTML代码
<div id=greatUltimate></div>
<p>旋转的太极图</p>
CSS代码
body {
background: #444;
}
#greatUltimate {
width: 200px;
height: 200px;
border-radius: 50%;
background: linear-gradient(to bottom, #ffffff 0%, #ffffff 50%, #000000 50%, #000000 100%);
position: relative;
margin: 100px auto 30px;
animation-name: spin;
animation-duration: 2s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
#greatUltimate::before {
content: '';
width: 20px;
height: 20px;
border-radius: 50%;
background: #fff;
position: absolute;
top: 50px;
left: 0;
border: 40px solid black;
}
#greatUltimate::after {
content: '';
width: 20px;
height: 20px;
border-radius: 50%;
background: #000;
position: absolute;
top: 50px;
right: 0;
border: 40px solid white;
}
p {
color: #fff;
text-align: center;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
效果
预览链接