如何使用文本视差 CSS 去除此图像中多余的空白

问题描述

我想知道如何去除下方和边缘的白色间距?我已经尝试删除 CSS 代码中的边距标签,但仍然没有解决问题。任何建议将不胜感激。

(function($) {
  /** change value here to adjust parallax level */
  var parallax = -0.8;

  var $bg_images = $(".wp-block-cover-image");
  var offset_tops = [];
  $bg_images.each(function(i,el) {
    offset_tops.push($(el).offset().top);
  });

  $(window).scroll(function() {
    var dy = $(this).scrollTop();
    $bg_images.each(function(i,el) {
      var ot = offset_tops[i];
      $(el).css("background-position","50% " + (dy - ot) * parallax + "px");
    });
  });
})(jQuery);
.wp-block-cover-image {
  position: relative;
  background-size: cover;
  background-position: 50%;
  min-height: 630px;
  width: 100%;
  margin: 0 0 0em;
  display: flex;
  justify-content: center;
  align-items: center;
}

.wp-block-cover-image .wp-block-cover-image-text,.wp-block-cover-image h2 {
  color: #fff;
  font-size: 1.5em;
  line-height: 1.25;
  z-index: 1;
  margin-bottom: 0;
  max-width: 670px;
  padding: 14px;
  text-align: center;
}

.wp-block-cover-image.has-background-dim:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: rgba(0,0.5);
}

.wp-block-cover-image {
  background-attachment: fixed;
  background-position: 50% 0;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="wp-block-cover-image has-background-dim" style="background- 
    image:url(https://static.wixstatic.com/media/cada49_c9adefa3849b4205bb675e04076fec28~mv2.jpg)">
  <p class="wp-block-cover-image-text"><strong>
    ABOUT US<br><br>    
    WHO WE ARE<br><br>
    Cakes by Sophie specializes in bespoke cakes and pastries for all types of events.  The finest 
    ingredients and utmost care go into each of our products. This is why Cakes by Sophie speak love.  
    When you want nothing but the best to remember life's greatest events,Cakes by Sophie is here for 
    you. <br><br>
    OUR MISSION<br><br>
    To bring you joy with every bite of our products,and to be a part of your best memories.<br>
    </strong></p>
</div>

我需要知道这段代码有什么问题,我无法删除下面的空白。提前致谢!

See Attached Image

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)