• 太极图


    <!DOCTYPE HTNL>
    <html lang="en">
    <html>
    <mate charset="utf-8">
    <head>
    <title></title>
    <style>
    *{padding:0;
    margin:0;}
    
    div{
    width:200px;
    height:200px;
    background-image: linear-gradient(90deg,red 50%,white 50%);
    position:relative;
    border-radius:50%;
    margin:200px auto;
    animation:zhuan 2s infinite linear;
    
    }
    div:before{
                content:"";
                width: 40px;
                height: 40px;
                background-color: white;
                border:30px solid red;
                position:absolute;
                left:50px;
                border-radius:50%;
                
     
            }
            div:after{
                content:"";
                width: 40px;
                height: 40px;
                background-color:red;
                border:30px solid white;
                position:absolute;
                left:50px;
                top:100px;
                border-radius:50%;
                
                
            }
     @keyframes zhuan{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}
    
    </style>
    </head>
    <body style="background-color:black;">
    <div></div>
    </body>

     太极图可以理解为一个一半黑一半白的半圆,上面放置着两个圆形,一个黑色边框白色芯,一个白色边框黑色芯。

    1、实现黑白各半的圆形。

     代码:

    200px;
    height:200px;
    background-image: linear-gradient(90deg,red 50%,white 50%);
    border-radius:50%;
    margin:200px auto;

     2、用:before伪类实现一个黑红色边框白色芯圆。

    div:before{
                content:"";
                width: 40px;
                height: 40px;
                background-color: white;
                border:30px solid red;
                position:absolute;
                left:50px;
                border-radius:50%;
                
     
            }

     3、用:after伪类实现一个白色边框红色芯的圆。

    div:after{
                content:"";
                width: 40px;
                height: 40px;
                background-color:red;
                border:30px solid white;
                position:absolute;
                left:50px;
                top:100px;
                border-radius:50%;
            }

  • 相关阅读:
    May 1 2017 Week 18 Monday
    April 30 2017 Week 18 Sunday
    April 29 2017 Week 17 Saturday
    April 28 2017 Week 17 Friday
    April 27 2017 Week 17 Thursday
    April 26 2017 Week 17 Wednesday
    【2017-07-04】Qt信号与槽深入理解之一:信号与槽的连接方式
    April 25 2017 Week 17 Tuesday
    April 24 2017 Week 17 Monday
    为什么丑陋的UI界面却能创造良好的用户体验?
  • 原文地址:https://www.cnblogs.com/niuyaomin/p/11616356.html
Copyright © 2020-2023  润新知