需要css为半圆填充完整的边框

时间:2017-02-28 17:13:29

标签: css

我希望css为圆形边框的半圆形。

enter image description here

2 个答案:

答案 0 :(得分:3)

这是你在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>
&#13;
&#13;
&#13;

答案 1 :(得分:0)

<!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>