我正在尝试使用具有滚动前端 div 的 css 将固定背景添加到 html 页面。但是在这样做之后我的 JavaScript 表单没有被加载。但是当我删除该图像并清除 css 时一切正常,
添加背景图片后的style.css:
html{
width:100%;
height:100%;
position:fixed;
background: url('../images/bg.png') no-repeat center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
}
body{
}
.wrap {
position:absolute;
width:100%;
overflow:scroll;
}
但是当我清除它时一切正常,
html{
}
body{
}
.wrap {
}
请看附件,
和
最佳答案
background-position: fixed;
代替
position: fixed;
编辑:虽然我不确定我是否完全理解您的问题。
关于javascript - 将固定背景图像和滚动前部 div 添加到 html 页面,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22483762/