Html 位置:修复了ICS(本机浏览器)中背景图像不可用的问题
我有一个基于jQM的移动web应用程序。我有一个应用了以下样式的背景图像:Html 位置:修复了ICS(本机浏览器)中背景图像不可用的问题,html,css,jquery-mobile,Html,Css,Jquery Mobile,我有一个基于jQM的移动web应用程序。我有一个应用了以下样式的背景图像: body.ui-mobile-viewport .ui-page { background: url('images/bg-texture.jpg') no-repeat fixed left bottom; -webkit-background-size: 100% 100%; -moz-background-size: 100% 100%; -o-background-size: 10
body.ui-mobile-viewport .ui-page
{
background: url('images/bg-texture.jpg') no-repeat fixed left bottom;
-webkit-background-size: 100% 100%;
-moz-background-size: 100% 100%;
-o-background-size: 100% 100%;
background-size: cover;
}
问题是,这在iOS、Android的Chrome上运行良好,但在ICS原生浏览器和Dolphin浏览器上,滚动开始后,背景会像这样贴在页面顶部:
在一些动作之后(比如轻敲一个元素),背景会像这样回到焦点:
我在网上查了一下,做了广泛的研究,但显然我遗漏了一些东西。以下是我尝试过的解决方案的链接:
img
标记,并将src
设置为图像所在的路径时,也会出现同样的问题
这些问题仅在本机浏览器中出现
如果我做错了什么,请告诉我。有没有一个纯CSS解决方案?(显然有些地方出了大问题)试试这个:
body.ui-mobile-viewport .ui-page
{
background: url('images/bg-texture.jpg') no-repeat fixed left bottom;
background-size: cover;
}
以下用于“html”的CSS解决了我在Android设备上的整页背景图像问题:
html{
height:100%;
width:100%
}
body{
background-image:url(img/background.jpg);
background-repeat:no-repeat;
background-attachment:fixed;
webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size:cover;
}
希望有帮助。这不起作用。这基本上就是问题所在,对吗?还是我遗漏了什么?