zoukankan      html  css  js  c++  java
  • CSS 太极图

    在学习CSS伪元素,看到人家画太极图挺意思,跟着画了一个。
    在这里插入图片描述
    将太极分为三部分,两个小圆和一个大圆,具体看代码把,感觉写的好无聊。。。

    <html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta http-equiv="X-UA-Compatible" content="ie=edge">
        <title>taiji</title>
        <link rel="stylesheet" href="./style.css" />
        <style>
            body{
                background-color: #ccc;
            }
    
            #taiji{
                width: 150px;
                height: 300px;
                margin: 100px auto;
                border-radius: 50%;
                background-color: white;
                border-left: 150px solid black;
            position: relative;
            }
    
            #taiji::before{    /*":before" 伪元素可以在元素的内容前面插入新内容*/
                content: '';
                position: absolute;
                width: 0px;
                height: 0px;
                padding: 25px;
                border-radius: 50%;
                border: 50px solid black;
                background-color: white;
                top:0px;
                left: -75px;
            }
    
            #taiji::after{    /*":after" 伪元素可以在元素的内容之后插入新内容*/
                content: '';
                position: absolute;
                width: 0px;
                height: 0px;
                padding: 25px;
                border-radius: 50%;
                border: 50px solid white;
                background-color: black;
                top:150px;
                left: -75px;
            }
        </style>
    </head>
    
    <body>
        <div id="taiji"></div>
    </body>
    </html>
    

    在这里插入图片描述

  • 相关阅读:
    一个奇怪的网页bug 竟然是局域网DNS搞的鬼
    繁体系统下如何快速将简体安装文件乱码恢复正常?
    Ubuntu16.04LTS国内快速源
    bitnami redmine版本由2.3.1升级至3.2.2过程
    Ubuntu1404安装gogs过程
    AJAX
    jQuery 事件解释
    安装phpMyadmi报错
    总结二
    总结
  • 原文地址:https://www.cnblogs.com/wangqilong/p/12540360.html
Copyright © 2011-2022 走看看