简单HTML+css太极图

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body {
            background-color: #666;
        }

        .box {
            position: relative;
            background-color: #fff;
            width: 300px;
            height: 300px;
            margin: 200px auto;
            border-radius: 50%;
        }

        .black {
            float: left;
            left: 0;
            height: 300px;
            width: 150px;
            background-color: #050505;
            border-radius: 150px 0 0 150px;
        }

        .h1 {
            position: absolute;
            right: 75px;
            background-color: #050505;
            width: 150px;
            height: 150px;
            border-radius: 50%;
        }

        .hy {
            position: absolute;
            right: 52px;
            top: 52px;
            width: 30px;
            height: 30px;
            background-color: #fff;
            border-radius: 50%;
        }

        .b1 {
            position: absolute;
            left: 75px;
            top: 150px;
            background-color: #fff;
            width: 150px;
            height: 150px;
            border-radius: 50%;
        }


        .by {
            position: absolute;
            right: 52px;
            top: 52px;
            width: 30px;
            height: 30px;
            background-color: #050505;
            border-radius: 50%;
        }

        /* .white {
            position: absolute;
            right: 0;
            height: 300px;
            width: 150px;
            background-color: #000;
            border-radius: 0 150px 150px 0;
        } */
    </style>
</head>

<body>
    <div class="box">
        <div class="black"></div>
        <div class="h1">
            <div class="hy"></div>
        </div>
        <div class="b1">
            <div class="by"></div>
        </div>

    </div>
</body>

</html>

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
好的,以下是一个用HTMLCSS实现太极八卦图的代码: ```html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>太极八卦图</title> <style> #taiji { width: 200px; height: 200px; border-radius: 50%; background: linear-gradient(90deg, #000000, #ffffff, #000000); position: relative; transform: rotate(45deg); } #taiji:before { content: ''; display: block; width: 100px; height: 100px; border-radius: 50%; background-color: #ffffff; position: absolute; top: 0; left: 50%; margin-left: -50px; } #taiji:after { content: ''; display: block; width: 100px; height: 100px; border-radius: 50%; background-color: #000000; position: absolute; bottom: 0; left: 50%; margin-left: -50px; } #taiji .yin { width: 50px; height: 50px; border-radius: 50%; background-color: #ffffff; position: absolute; top: 25px; left: 50%; margin-left: -25px; } #taiji .yang { width: 50px; height: 50px; border-radius: 50%; background-color: #000000; position: absolute; bottom: 25px; left: 50%; margin-left: -25px; } #taiji .left { width: 50px; height: 50px; border-radius: 50% 0 0 50%; background-color: #000000; position: absolute; top: 75px; left: 0; } #taiji .right { width: 50px; height: 50px; border-radius: 0 50% 50% 0; background-color: #ffffff; position: absolute; top: 75px; right: 0; } #taiji .left:before { content: ''; display: block; width: 25px; height: 50px; background-color: #ffffff; position: absolute; top: 0; left: 0; } #taiji .right:before { content: ''; display: block; width: 25px; height: 50px; background-color: #000000; position: absolute; top: 0; right: 0; } #taiji .left:after { content: ''; display: block; width: 50px; height: 50px; background-color: #000000; position: absolute; top: 0; left: 25px; border-radius: 50%; transform: rotate(45deg); } #taiji .right:after { content: ''; display: block; width: 50px; height: 50px; background-color: #ffffff; position: absolute; top: 0; right: 25px; border-radius: 50%; transform: rotate(45deg); } </style> </head> <body> <div id="taiji"> <div class="yin"></div> <div class="yang"></div> <div class="left"></div> <div class="right"></div> </div> </body> </html> ``` 这段代码会生成一个200*200大小的太极八卦图,使用了CSS3的渐变、旋转、倾斜等属性来实现。同时,八卦图内部的阴、阳两极和四个小半圆也使用了CSS绘制
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小慌写代码

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值