太极图有没有更简洁的代码

太极图有没有更简洁的代码

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>2-5</title>
    <style type="text/css">
        div {
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            box-sizing: border-box;
            width: 400px;
            height: 400px;
            margin: auto;
            border: 1px solid red;
            border-bottom: 200px solid red;
            border-radius: 50%;
            transform-origin: 50% 50%;
            animation-name: rotate;
            animation-duration: 2s;
            animation-timing-function: linear;
            animation-iteration-count: infinite;
            /*此处写代码*/
        }        div::after{
             content: ""; display: block;
             position: absolute;
             top:100px;  left: -1px;
             box-sizing: border-box;
             width: 199px; height: 199px;
             border-top: 101px solid red;
             border-radius: 50%;
         }         div::before{
             content: ""; display: block;
             position: absolute;
             top:100px; left: 199px;
             box-sizing: border-box;
             width: 199px; height: 199px;
             border-bottom: 101px solid white;
             border-radius: 50%;
         }         div > span{
             position: absolute;
             width: 40px; height: 40px;
             display: block;
             border-radius: 50%;
         }         div > span:first-of-type{
             z-index: 10000;
             left: 70px; top: 150px;
             background: white;
         }
          div > span:last-of-type{
             z-index: 10000;
             left: 270px; top: 150px;
             background: red;
         }         @keyframes  rotate{
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
         }    </style>
</head>
<body>
    <div>
        <span></span>
        <span></span>
    </div>
</body>
</html>

正在回答

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

1回答

你写的已经很好了,继续加油!

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

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

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

0 星
请稍等 ...
微信客服

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

帮助反馈 APP下载

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

公众号

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

在线咨询

领取优惠

免费试听

领取大纲

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