太极图这样可可以吗?

太极图这样可可以吗?

<!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

正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

1回答
小丸子爱吃菜 2018-01-12 18:35:59

经测试,代码的效果实现的很不错呢~

祝学习愉快!

问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星

相似问题

登录后可查看更多问答,登录/注册

响应式开发与常用框架 2018
  • 参与学习           人
  • 提交作业       2198    份
  • 解答问题       5012    个

如果你有web端基础,既想进阶,又想进军移动端开发,那就来吧,我们专题为你带来的课程有HTML5、CSS3、移动基础、响应式、bootstrap、less等,让你在前端道路上畅通无阻!

了解课程
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师