【问题标题】:add padding-top to the entire jQuery Mobile page将 padding-top 添加到整个 jQuery Mobile 页面
【发布时间】:2013-12-10 17:18:33
【问题描述】:

我希望将padding-top20px 添加到我的整个jQuery Mobile 页面。 (data-role="header" data-position="fixed" 元素位于页面顶部)。我怎样才能做到这一点?

body{
    padding-top: 20px;
}

不起作用。我该如何解决这个问题?

【问题讨论】:

    标签: jquery jquery-mobile padding


    【解决方案1】:

    这里有什么关于这个的?

    .ui-page {
        padding-top: 20px;
    }
    

    这个更好?

    .ui-content {
        margin-top: 40px;
    }
    

    【讨论】:

    • 不,它没有降低标题
    • 所以新的解决方案会降低除标题之外的所有内容,可能是因为它是data-position="fixed"
    • .ui-content, #header { margin-top: 20px; } 似乎有效,现在我只需要更改边距所在位置的背景颜色。
    • 应该是“.ui-page”
    • .ui-page{ background-color: green !important; } 不起作用。
    猜你喜欢
    • 2013-07-16
    • 1970-01-01
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-25
    相关资源
    最近更新 更多