Firefox 显示固定背景,Chrome 显示滚动背景

问题描述 投票:0回答:1

也许有人知道如何正确解决这个问题? 我的网站是用 Wordpress 制作的。 源页面完全相同,但页面背景有问题,而它在 Firefox 上显示为固定(并且大小也正确/覆盖),在 Chrome 上它被放大并随页面滚动。

页面示例: 网站在这里

Chrome 显然因这个问题而闻名,但我想知道是否有一个有效的解决方法来解决并以原始比例查看我的背景(当然也可以在设备上响应)

谢谢你让我知道, 布鲁诺

我找不到解决方案,因为代码实际上是相同的,只是浏览器响应能力发生了变化

google-chrome firefox scroll background fixed
1个回答
0
投票

好的,我找到了代码(附后):

enter image description here

铬:

.edgtf-parallax-row-holder {
  height: auto!important;
  min-height: 200px!important;
  background-attachment: scroll;
  background-position: center top!important;
  background-size: cover
}

火狐

.edgtf-parallax-row-holder {
  position:static;
  padding:0;
  background-attachment:fixed;
  background-color:transparent;
  background-position:center 0;
  background-repeat:no-repeat;
  -webkit-transform:translateZ(0);
  transform:translateZ(0);
  -moz-transform:none;
  overflow:hidden
}

问题是 Chrome 强制拒绝“封面”标签,而且如果我尝试将背景附件从“滚动”更改为“固定”,则不会保持在原位。

© www.soinside.com 2019 - 2024. All rights reserved.