弧边效果
html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="index.css" />
</head>
<body>
<div class="edge-bg"></div>
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
css
.edge-bg {
width: 284px;
height: 46px;
margin: 0 auto;
background-color: #ffebec;
border-radius: 0 0 20px 20px;
position: relative;
transform-origin: center top;
transform: perspective(20px) rotateX(-3deg);
}
.edge-bg::before,
.edge-bg::after {
content: "";
position: absolute;
width: 10px;
height: 10px;
background-color: #ffebec;
top: 0;
}
.edge-bg::before {
left: -10px;
background: radial-gradient(
circle at 0 100%,
transparent 10px,
#ffebec 10px
);
}
.edge-bg::after {
right: -10px;
background: radial-gradient(
circle at 100% 100%,
transparent 10px,
#ffebec 10px
);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35