背景附件:固定不工作在Android /手机 [英] Background-attachment: fixed not working on android/mobile
本文介绍了背景附件:固定不工作在Android /手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一个应用程序,科尔多瓦,我试图让一个固定的背景。不幸的是,它似乎并不奏效,而且只要我向下滚动的背景简单地熄灭页面的顶部。下面是我使用这样做的CSS(我已经尝试过其他几种方式):
I'm developing a cordova app and I'm trying to get a fixed background. Unfortunately, it doesn't seem to be working, and anytime I scroll down the background simply goes off the top of the page. Here's the CSS I'm using to do this (and I've tried it several other ways):
html {
width:100%;
height: 100%;
background-color:#000000;
background-image:url('../img/bg_reader.jpg');
/*background-repeat:no-repeat;
background-attachment: fixed;
background-position: center;*/
background-size: 100% 100%;
}
不管是什么,背景滚出当我向下滚动,如果固定属性未设置在屏幕的顶部。
No matter what, the background scrolls off the top of the screen when I scroll down as if the fixed property weren't set.
推荐答案
您是否尝试过这个?
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
background-color:#000000;
background-image:url('../img/bg_reader.jpg');
}
这篇关于背景附件:固定不工作在Android /手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文