【问题标题】:Background fixed phonegap后台固定phonegap
【发布时间】:2013-04-05 07:37:23
【问题描述】:

我对 Phonegap 的背景有疑问

我也在使用 JQuery 移动版

这是我生成背景的css代码

html, body {
    top: 0px;
    left: 0px;
    height: 100%;
    width: 100%;
} 

.ui-page{
    top: 0px;
    left: 0px;
    background: url('../img/bg.jpg') 0 0 no-repeat fixed !important;
    background-size: auto 100%;
    height: 100%;
    width: 100%;
    font-family: MankSans;
    background-position:fixed;
    background-color:#102a3e;
}

当我在页面中滚动时,我的背景停留在顶部,但我的背景未获取的部分保持白色,我不明白为什么

感谢您的帮助

【问题讨论】:

    标签: css cordova background


    【解决方案1】:

    从您的样式中删除!important。这会覆盖您的background-color。只需使用

    .ui-page {
        background: #102a3e url('../img/bg.jpg') 0 0 no-repeat fixed;
    }
    

    【讨论】:

    • 谢谢,但重要的是尝试调试,没有重要的我也有同样的问题
    • @ant,我明白了,您是否尝试过像我的示例中那样结合颜色和图像样式(同时使用 !important)?
    • 有没有工作的例子可以看?会对覆盖 !important 的内容非常感兴趣。
    • 重要的是尝试一下,因为我使用的是 JQuery mobile,我认为它们可能是另一个元素。这是应用程序问题的一个屏幕heberger-image.fr/data/images/…
    • 嗯,也许有。我唯一可以肯定的是background-color:#102a3ebackground: url('../img/bg.jpg') 0 0 no-repeat fixed !important 覆盖。所以这可能是background-color 没有出现的原因。如果连background: #102a3e url('../img/bg.jpg') 0 0 no-repeat fixed !important 都不起作用,我不知道该怎么办。
    猜你喜欢
    • 2015-07-02
    • 1970-01-01
    • 2014-07-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-20
    • 1970-01-01
    相关资源
    最近更新 更多