使用css的弯曲的盒子

Gan*_*tta 6 css html5 jquery-ui css3

我试图设计如下图像,仍然没有得到结果,请帮助我.任何帮助,将不胜感激

期望的图像效果

<!DOCTYPE html>
<html>
<head>
<style> 
#rcorners1 {
    border-radius: 10px 90px 90px 10px / 8% 100% 100% 8%;
    background: #18b1a0;
    padding: 20px; 
    width: 200px;
    height: 150px;    
}
</style>
</head>
<body>
<p id="rcorners1">Rounded corners!</p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

小智 2

使用@Krusader的评论,您可以添加position:relative; 到#rcorners1。然后使用以下 CSS 添加伪元素 (::after):

#rcorners1::after {
content: "";
position: absolute;
top: 10%;
left: -15px;
width: 30px;
height: 80%;
background-color: green;
border-radius: 100%;
} 
Run Code Online (Sandbox Code Playgroud)

所以完整的 CSS 看起来像这样:

#rcorners1 {
position: relative;
background: #18b1a0;
padding: 20px; 
width: 200px;
height: 150px;   
border-radius: 10px 90px 90px 10px / 8% 100% 100% 8%;
overflow: hidden;
}
#rcorners1::after {
content: "";
position: absolute;
top: 10%;
left: -15px;
width: 30px;
height: 80%;
background-color: green;
border-radius: 100%;
}
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助。