【问题标题】:Need css for half filled circle with complete border需要带有完整边框的半填充圆圈的css
【发布时间】:2023-03-18 14:51:01
【问题描述】:

我想要带有圆形边框的半实心圆的 css。

enter image description here

【问题讨论】:

标签: css


【解决方案1】:
<!DOCTYPE html>
<html>
<head></head>
<style>
#circle {
    border-radius: 100%;
    height: 100px;
    width: 100px;
    border: solid black 3px;
}


#p1 {
    border-top-left-radius: 50px;
    border-bottom-left-radius: 50px;
    background-color: green;
    width: 49%;
    height: 100%;
    border-right: solid black 2px;
}
</style>
<body>
    <div id="circle">
        <div id="p1"></div>
    </div>
</body>
</html>

【讨论】:

    【解决方案2】:

    这就是你可以在 CSS 中实现它的方法。

    .wrapper{
      width: 100px; height: 100px;
      border-radius: 50%;
      border: 3px solid black;
      overflow: hidden;
    }
    
    .one{
      display: inline-block;
      background-color: green;
      height: 100px; width:50px;
      border-right: 2px solid black;
    }
    
    .two{
      display: inline-block;
      background-color: white;
      height: 100px; width:50px;
    }
    <div class="wrapper">
    <div class="one"></div>
    <div class="two"></div>
    </div>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-21
      • 1970-01-01
      • 1970-01-01
      • 2020-09-07
      • 1970-01-01
      • 2014-04-20
      • 2021-05-15
      • 2016-05-24
      相关资源
      最近更新 更多