CSS 实现半圆环的两种方式


方式一:

<div style="
    width: 50px;
    height: 50px;
    border: 13px solid orange;
    border-radius: 50px;
    clip-path: polygon(50% 0%, 100% 0%, 100% 3600%, 50% 50%);
    -webkit-clip-path: polygon(50% 0%, 100% 0%, 100% 3600%, 50% 50%);
"></div>

效果:

 

 

方式二:

</head>
        <style>
            .circle {
                position: relative;
                box-sizing: border-box;
            }
            
            .big {
                width: 140px;
                height: 140px;
                border-radius: 50%;
                position: absolute;
                margin: auto;
                /*以下五个属性为水平垂直居中的方法*/
                left: 0;
                top: 200px;
                right: 0;
                bottom: 0;
                box-sizing: border-box;
            }
            
            .small {
                width: 136px;
                height: 136px;
                border: 10px solid #9DDBE8;
                border-radius: 50%;
                position: absolute;
                margin: auto;
                /*以下五个属性为水平垂直居中的方法*/
                left: 0;
                top: 200px;
                right: 0;
                bottom: 0;
                box-sizing: border-box;
                border-bottom-color: transparent;
            }
        </style>
    </head>

    <body>
        <div class="circle">
            <div class="big"></div>
            <div class="small"></div>
        </div>
    </body>

效果:

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM