【发布时间】:2017-03-30 19:08:38
【问题描述】:
我想只在图像的边界上将渐变不透明度从 100% 设置为 0%。
例如,我可以像这里那样在图像的一个方向上制作渐变不透明度(底部有渐变)
.opacitygradient{
-webkit-mask-image: -webkit-gradient(linear, left top,
left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));
}
<img src="http://placehold.it/300x300" class="opacitygradient">
但我希望在每一侧(所有边框)都有 10px 的渐变,而不是像上面的 sn-p 那样只有一个方向。
有什么想法吗?
【问题讨论】:
-
你有你想要的结果的示例图像吗?