【发布时间】:2021-02-22 17:47:28
【问题描述】:
【问题讨论】:
-
不可能。您需要使用 SVG 或画布来绘制该路径。
【问题讨论】:
背景可以做到:
.box {
width: 200px;
height: 150px;
background: radial-gradient(180% 180% at right -65% top -65%, transparent 99%, red )
}
<div class="box"></div>
【讨论】:
另一种方法,将您所在的背景与伪匹配:覆盖您需要的部分后:
尽管我更喜欢上面的@Temani Afif 回答。
#curved-triangle::after {
content: "";
position: absolute;
top: -100px;
left: 0px;
background: #fff;
width: 200px;
height: 200px;
border-radius: 100%;
}
#curved-triangle {
width: 0;
height: 0;
border-left: 0px solid transparent;
border-right: 100px solid transparent;
border-bottom: 100px solid red;
position: relative;
}
<div id="curved-triangle"></div>
【讨论】: