【发布时间】:2016-07-04 03:04:01
【问题描述】:
该部分有一个背景图片,顶部有内容。 我只想降低部分中背景图像的亮度,而不是内容。
我尝试了下面的方法,但是亮度仍然适用于所有人,而不仅仅是图像。
<!-- Section -->
<div id="section1">
<div id="content">
<h1 class="heading">headline text</h1>
<h4 class="subHeading"> Sub-headline text</h4>
<!-- Call to action button -->
<br><br>
<button> Join our wait list </button>
</div>
#section1 {
background: url('../images/headerimage1.jpg') center center no-repeat;
background-size: cover;
-webkit-filter: brightness(0.5);
filter: brightness(0.5);
padding-top: 100px;
padding-bottom: 100px;
padding-left: 10%;
padding-right: 10%;
color: white;
text-align: center;
}
#content {
-webkit-filter: brightness(1);
filter: brightness(1);
}
【问题讨论】: