我正在尝试添加一个半透明的层之间的背景图像和索引任何层是如何不显示。我使用了z索引,但没有working.Is这里有什么解决方案吗?或者我需要使绝对定位的背景图像和背景颜色?
如果我使用z-index:-1,它就在all..and后面,如果我使用1,那么i就在所有索引的前面
<div class="bg">
<div class="mask"></div>
<div class="content">
<h2>Hello There</h2>
</div>
</div>
和Css代码是
.bg{
background: url('http://support.kaziwood.com/wp-content/uploads/2018/06/member-1.png') no-repeat;
height:200px;
}
.content{padding:70px 130px}
.mask{
background:#000;
position:absolute;
content:'';
width:100%;
height:100%;
left:0;
top:0;
opacity:0.3;
z-index:-1;
}
https://stackoverflow.com/questions/50668364
复制相似问题