【发布时间】:2018-04-26 14:49:07
【问题描述】:
我想只使用 html 和 css 创建图像掩码。不使用 svg 或背景图片。
剪辑蒙版需要使用<img src='">。没有背景图片我无法做到这一点。
.pic-mask {
position:relative;
}
.pic-mask:before {
content: "";
display: block;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(63, 72, 48, 0.8);
-moz-transition: background .3s linear;
-webkit-transition: background .3s linear;
-ms-transition: background .3s linear;
-o-transition: background .3s linear;
transition: background .3s linear;
}
<div class="pic-mask">
<img src="https://im.ezgif.com/tmp/ezgif-1-1bf1c27255.jpg" width="500">
</div>
我的预期输出如下图所示
【问题讨论】:
标签: html css twitter-bootstrap image