【问题标题】:Blurring Background image shrinks it, how to blur without it shrinking?模糊背景图像缩小它,如何在不缩小的情况下模糊?
【发布时间】:2018-08-27 12:51:05
【问题描述】:

without blurwith blur 我是 html,css 的初学者。我正在尝试模糊每个 div 的背景图像,但它会将其缩小。如何在不缩小的情况下进行模糊处理?

.parallax {
  /*height: 500px;*/
  height: 100vh;
  font-size: 200%;
  overflow-x: hidden;
  overflow-y: auto;
  perspective: 300px;
  perspective-origin-x: 100%;
}
.parallax .title {
  font-family: 'Lato', sans-serif;
  font-weight: bold;
  color: #424242 black;
  position: absolute;
  left: 50%;
  top: 50%;
  text-align: center;
  transform: translate(-50%, -50%);
}

/* below trying to blur */

.parallax .group2 .back {
  background: #ffdfba;
  background-image: url("image/bubble.png");
  background-size:contain;
  -webkit-filter: blur(5px);
  filter: blur(5px);
  height: 500px;
  height: 100vh;
}
  <div class="group group2">
          <div class="layer base">
              <div class="title">
                  Blowing Bubbles are fun! They help calm yourself and give you qualities to breath.
              </div>
          </div>
          <div class="layer back">
              <div class="title">

              </div>
          </div>
      </div>

【问题讨论】:

    标签: html css filter background-image blur


    【解决方案1】:

    background-size: cover 用于.parallax .group2 .back。背景图像将覆盖整个 div 区域。 希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2011-07-29
      • 2018-01-19
      • 2016-10-20
      • 1970-01-01
      • 1970-01-01
      • 2012-04-18
      • 2020-12-09
      • 1970-01-01
      • 2022-12-05
      相关资源
      最近更新 更多