规则阴影
coderljw 2024-10-13 小于 1 分钟
# clip-path: polygon()
<main>
<section>Magic</section>
</main>
1
2
3
2
3
main {
height: 400px;
display: grid;
place-items: center;
filter: drop-shadow(2px 4px 3px hsla(60, 100%, 10%, 0.5));
}
section {
display: grid;
place-items: center;
width: 200px;
height: 60px;
font-size: 20px;
color: #be9451;
user-select: none;
background: linear-gradient(#f5e5bf, #fbe8c8, #f5e5bf);
clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0 50%);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18