css为图片添加一层蒙版并在上层显示文字等

时间:2019-10-28 12:35:19   收藏:0   阅读:513

效果图:

技术分享图片

代码如下:

<div class="row" style="width:100%; position:relative;z-index:1;margin:0 auto; background: #000;">
    <img src="~/images/touxiang.jpg" style="width:100%; opacity:0.6; filter: alpha(opacity=60);"/>
    <div style="width:100%;position:absolute;z-index:2;top:50%; text-align:center;">
        <h2 style="color:#fff">文字浮动在图片上方</h2>
    </div>
</div>

 

原文:https://www.cnblogs.com/yechangzhong-826217795/p/11751192.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!