【发布时间】:2015-08-12 21:52:58
【问题描述】:
我正在尝试使我的背景成为一张带有过滤器的图片,前面有一个 div。问题是第二个 div 也有过滤器,我不能禁用它。
<section class="section-1">
<div class="content-section-1">
<p>Lorem ipsum dolor...</p>
</div>
</section>
.section-1 {
box-sizing: border-box;
height: 100vh;
padding: 110px 10% 50px 10%;
min-height: 500px;
background-color: aqua;
background-image: url(http://s.hswstatic.com/gif/climbing-mount-everest-5.jpg);
background-size: cover;
background-position: center;
-webkit-filter: blur(4px) opacity(0.6);
filter: blur(4px) opacity(0.6);
}
.content-section-1 {
padding: 15px;
background-color: rgba(0, 0, 0, 0.6);
-webkit-filter: none;
filter: none;
width: 100%;
height: 100%;
}
【问题讨论】:
-
您需要重新排列 HTML。这是同样的问题+解决方案*.com/questions/22406478/…