在我的Phonegap应用程序上,我试图找出一个固定的页脚和标题,实际上在Android 4.0中工作得很好.但是在Android 2.3上,即使它看起来没问题,当我开始滚动页眉和页脚时根本不会保持固定,与滚动一起.
相关代码如下:
HTML:
<div class="container-fluid no-padding">
<div id="header">
</div>
<div class="wrapper">
<div id="main-content"></div>
<div id="push"></div>
</div>
<div id="footer" class="main-footer">
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
html,body,.container-fluid {
height: 100%;
font-family: Helvetica !important;
}
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
padding-left: 10px;
padding-right: 10px;
margin-left: 0;
margin-right: 0;
margin-bottom: -20px; /* the bottom margin is the negative value of the footer's height */
overflow: scroll;
}
#footer, #push {
height: 20px; /* .push must be the same height as .footer …Run Code Online (Sandbox Code Playgroud)