【发布时间】:2013-07-13 22:45:36
【问题描述】:
我正在开发一个 Cordova 应用程序,并试图获得一个固定的背景。不幸的是,它似乎不起作用,并且每当我向下滚动背景时,它都会离开页面顶部。这是我用来执行此操作的 CSS(我已经尝试了其他几种方法):
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%;
}
无论如何,当我向下滚动时,背景会滚动到屏幕顶部,就好像没有设置固定属性一样。
【问题讨论】:
标签: android css web cordova background-attachment