【发布时间】:2019-12-03 09:08:09
【问题描述】:
我想创建这个只有背景的形状。或者可能是剪辑路径和伪元素。
到目前为止,我尝试使用::before
div {
height: 300px;
width: 400px;
background: tomato;
border-radius: 0 0 5px 0;
position: relative;
}
div::before {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: inherit;
height: 400px;
background: red;
bottom: -395px;
border-radius: 0 0 400px 0;
}
.abs {
width: 400px;
position: absolute;
top: 0;
left: 0;
}
body {
margin: 0;
}
<div></div>
<img src="https://i.hizliresim.com/LvZGL1.png" alt="" class="abs"> <!-- intended shape -->
【问题讨论】:
-
当您希望有人解决您的问题时添加代码。
-
@VipulSharma 是的。但底部半径与以下答案不同。边界半径不可能。可能是 svg、线性渐变或剪辑路径。
-
@dgknca 然后至少发布你到目前为止的问题代码进度
标签: css css-shapes linear-gradients radial-gradients