你好 ![]()
我没有测试过,但看起来是 background-attachment: fixed; 引起的。
你上面分享的代码是:
.title-container {
background: no-repeat center/cover fixed;
}
这意味着:
.title-container {
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-attachment: fixed; // 这会导致问题
}
在这种情况下,background-attachment: fixed; 是必需的吗?
我的意思是,我认为它可能会产生一种视差效果。但这并不是实现该效果的最佳解决方案……因为它支持性不强,而且可能对你的用例来说不是必需的。