gpt4 book ai didi

css - 为什么背景图片带有附件 :fixed and transform:scale moves on scroll?

转载 作者:行者123 更新时间:2023-11-28 15:55:43 24 4
gpt4 key购买 nike

背景在没有 transform:scale 的情况下按预期运行

添加 transform:scale 值后出现不需要的视差效果:http://codepen.io/fekla/pen/VmqPZa (向下滚动)。

  <div class="holder">
<div class="image"></div>
</div>


html,body {
margin:0px;
padding:0px;
height:100%;
width:100%;
}
.holder {
width:100%;
height:100%;
background-color:black;
overflow: hidden;
}
.image {
width:100%;
height:100vh;
background-image: url(http://lorempixel.com/output/nature-q-c-884-338-5.jpg);
background-attachment: fixed;
background-size: cover;
background-position: center;
transform: scale(1.25);
}

最佳答案

似乎是一个已知的 Webkit 错误: https://bugs.chromium.org/p/chromium/issues/detail?id=20574附言似乎也没有兴趣实际修复它

关于css - 为什么背景图片带有附件 :fixed and transform:scale moves on scroll?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41187550/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com