CSS模糊图像效果

时间:2017-03-02 06:40:31

标签: css

我正在尝试在页面正文中显示全宽图像。不是背景。在这个图像的中心id就像一个模糊背景图像的条形图。然后就像栏上的文字一样。

这是我得到的:

#superimagecontainer {
  position: relative;
  height: auto;
}

#container4 {
  position: absolute;
  left: 0px;
  width: 100%;
  height: auto;
  overflow: hidden;
  z-index: 0;
}

#container4 img {
  width: 100%;
  position: relative;
  z-index: 0;
}

#container4b {
  position: absolute;
  top: 50%;
  left: 0px;
  width: 100%;
  height: 100px;
  overflow: hidden;
  z-index: 1;
}

#container4b img {
  width: 100%;
  position: relative;
  filter: blur(3px) brightness(50%);
}

h8 {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  color: #fff;
  padding: 18px;
  font-size: 25px;
  letter-spacing: 10px;
  opacity: 0.75;
}
<div id="superimagecontainer">
  <div id="container4">
    <img src="img/buildings750.jpg" alt="" />
  </div>
  <div id="container4b">
    <img src="img/buildings750.jpg" alt="" />
    <h8>THIS IS THE BEST TEXT SAMPLE EVER</h8>
  </div>
</div>

0 个答案:

没有答案