drop-shadow整体添加阴影
于2022-12-12 15:24:24发布
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=q, initial-scale=1.0">
<title>Document</title>
<style>
.ctx {
width: 200px;
height: 200px;
position: relative;
background: #fff;
margin: 100px auto;
filter: drop-shadow(0 0 3px #888);
}
.ctx::after {
position: absolute;
content: '';
width: 0;
height: 0;
border-top: 10px solid transparent;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-bottom: 10px solid #fff;
top: -20px;
left: 20px;
}
</style>
</head>
<body>
<div class="ctx"></div>
</body>
</html>
运行效果