使用方法:在需要加阴影的div上设置css
<div class="style">
.icon {
width: 36px;
height: 36px;
margin-top: 4px;
margin-right: 10px;
border-radius: 4px; //圆角配置
box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); //外阴影配置
box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5) inset; //内阴影配置
background: #707070;
}
通常我们拿到UI提供的设计稿,需要点击查看圆角和阴影的配置。
颜色:若无透明度要求,使用#4AA9FC或rgb(0, 0, 0)均可;若需要填写透明度,则使用rgba(0, 0, 0,0.5)
0.5则为透明度50%