向背景图像CSS添加不透明度以覆盖英雄

时间:2018-10-18 01:20:56

标签: html css

我想知道是否有可能取消第二个div /类opacity并使用hero类上的CSS将不透明度添加到图像中?

.hero {
  background-image: url('https://cdn10.bostonmagazine.com/wp-content/uploads/sites/2/2016/03/nkotb.jpg');
  background-size: cover;
  position: relative;
  height: 500px;
}

.hero .opacity {
  background-color: rgba(0, 0, 0, 0.5);
  height: 100%;
}
<div class="hero">
  <div class="opacity">
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

您可以使用多个背景图像,所有现代浏览器都使用supported

x_values[i1] < x_values[i2]
df = pd.DataFrame({'Species':['woodpecker', 'woodpecker', 'dove', 'mockingbird'], 'Birder':['Steve', 'Ben','Ben','Greg']})

ben_unique_bird = [x for x in range(len(df['Species'])) if df['Birder'][x]=='Ben' and df['Species'][x].is_unique()]