代码:
<div class="parent">
<i class="icon"></i>
</div>
.parent{
overflow: hidden;//父元素对超出的部分进行隐藏
.icon {
background: url('https://chu-nuo.com/static/image/icon/mine-checked.png') no-repeat;
background-position: 0 0;
background-size: 100% 100%;
width: 40rpx;
height: 40rpx;
filter: drop-shadow(0px 150px 0px #3387FF);
transform: translateY(-150px);
}
}
<div class="parent">
<img src="图片地址">
</div>
.parent{
overflow: hidden;//父元素对超出的部分进行隐藏
img {
filter: drop-shadow(0px 150px 0px #3387FF);
transform: translateY(-150px);
}
}