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

代码如下:
<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> 相关推荐
qiupu 2020-11-04
jiedinghui 2020-10-25
Ladyseven 2020-10-22
hellowzm 2020-10-12
zuncle 2020-09-28
Ladyseven 2020-09-11
jiedinghui 2020-09-07
xiaohuli 2020-09-02
葉無聞 2020-09-01
impress 2020-08-26
ThikHome 2020-08-24
nicepainkiller 2020-08-20
hellowzm 2020-08-18