html 边框轮廓,CSS半圈(边框,仅轮廓)
小編典典
您可以使用border-top-left-radius和border-top-right- radius屬性根據框的高度(和添加的邊框)在框上四角。
然后在框的頂部/右側/左側添加邊框以達到效果。
干得好:
.half-circle {
width: 200px;
height: 100px; /* as the half of the width */
background-color: gold;
border-top-left-radius: 110px; /* 100px of height + 10px of border */
border-top-right-radius: 110px; /* 100px of height + 10px of border */
border: 10px solid gray;
border-bottom: 0;
}
或者,您可以將其添加box-sizing: border- box到框中以計算框的寬度/高度,包括邊框和填充。
.half-circle {
width: 200px;
height: 100px; /* as the half of the width */
border-top-left-radius: 100px;
border-top-right-radius: 100px;
border: 10px solid gray;
border-bottom: 0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
2020-05-16
總結
以上是生活随笔為你收集整理的html 边框轮廓,CSS半圈(边框,仅轮廓)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 四川对口高职本科学校计算机,2018四川
- 下一篇: 路由器不用网线怎么连接wifi如何让路由