当我使用 chrome 时,我的背景图像在带有 background-attachment:fixed 的 chrome 中移动......但它在 firefox 上工作正常。请帮助我......
在此输入验证码
.bkimg1
{
background-image: url('justice-league1.jpg');
background-attachment: fixed;
height: 100%;
margin:0px;
padding:0px;
background-position:top;
background-size: cover;
position: relative;
opacity: 0.8;
background-repeat: no-repeat;
max-width:1100px;
}
<div class="bkimg1">
<div class="text">
<div class="border">
WELCOME EVERYONE
</div>
<input type="button" value="Get Started" onclick="init(),scrolldownpage('profiles')"/>
</div>
</div>
谢谢
最佳答案
尝试更改 background-position
属性。:
backgroun-position: center;
请查看此链接以获取更多详细信息。 https://www.w3schools.com/cssref/pr_background-position.asp
关于javascript - 使用背景附件 :fixed 时图像在 chrome 中移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50934575/