2012-08-23 38 views
2

我正在使用jquery mobile。 我創建了一個非常簡單的頁面,其中有一個固定的頁眉和頁腳。我在該頁面上只有兩個按鈕。頁腳固定爲底部,因此頁面的一半爲銀色(data-theme = c),一半作爲灰色(底部頁面)。內容應該從頁眉填充到頁腳footerin

我希望整個頁面從頁眉到頁腳都是銀色(根據指定的主題),無論我想在一頁上放置多少內容。 這可能嗎?

<div data-role="page" data-theme="b" id="ui-page-start" class="ui-page-active"> 
    <div data-role="header" data-theme="b" data-backbtn="false"> 
     </div> 

    <div data-role="content" class="ui-content" role="main" style="text-align: center;"data-theme="c"> 
    <br/> 
    <div> 
     <input type='text' id='jid' placeholder="JID" data-mini="true" value='[email protected]' style="border-radius: 10px;"> 

     <input type='password' data-mini="true" id='password' placeholder="Password"style="border-radius: 10px;"> 
     </div>     

    </div> 
    <div data-role="footer" data-position="fixed" class="ui-bar-a fade " role="contentinfo" style=": 212px; "> 
     </div> 

</div> 

回答

0

我做到這一點使用CSS刪除從data-role="content" DIV的背景,並應用它,而不是到data-role="page"股利。這是顯示在用行動表明一個jsbin:

http://jsbin.com/ijeqiy/2/

您可以通過使用.ui-body-類針對個人的主題。例如,在您的代碼中,您在頁面div上使用主題b,因此您可以像這樣覆蓋它:

.ui-body-b {  
    background: #F9F9F9; /* the background color you want */ 
} 

.ui-content { 
    background: none; /* remove the background color from the content because it's not long enough */ 
} 
+0

太棒了!完成完成。 –

相關問題