太极图这样可可以吗?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>2-5</title>
<style type="text/css">
.big-circle {
position: relative;
box-sizing: content-box;
width: 400px;
height: 200px;
margin: auto;
border: 1px solid red;
border-bottom: 200px solid red;
border-radius: 50%;
transform-origin: 50% 50%;
animation-name: rotate;
animation-duration: 5s;
animation-timing-function: linear;
/*此处写代码*/
animation-iteration-count: infinite;
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.circle {
position: absolute;
width: 200px;
height: 200px;
border-radius: 50%;
}
.red {
background-color: red;
}
.white {
background-color: white;
}
.middle-red {
top: 100px;
left: 0;
}
.middle-white {
top: 100px;
left: 200px;
}
.inner-white {
transform: scale(0.2);
top: 100px;
left: 0;
}
.inner-red {
transform: scale(0.2);
top: 100px;
left: 200px;
}
</style>
</head>
<body>
<div class="big-circle">
<div class="circle red middle-red"></div>
<div class="circle white middle-white"></div>
<div class="circle red inner-red"></div>
<div class="circle white inner-white"></div>
</div>
</body>
</html>太极图这样可可以吗?看到原有代码里面给大圆的定位是absolute,不知道怎么实现,我把它改成了relative
45
收起
正在回答 回答被采纳积分+1
响应式开发与常用框架 2018
- 参与学习 人
- 提交作业 2198 份
- 解答问题 5012 个
如果你有web端基础,既想进阶,又想进军移动端开发,那就来吧,我们专题为你带来的课程有HTML5、CSS3、移动基础、响应式、bootstrap、less等,让你在前端道路上畅通无阻!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星