我正在开发一个基本上包含三个divs
页眉、内容和页脚的移动网站。我希望页眉和页脚固定,如果溢出,内容可滚动。现在我的CSS是:
#header{
top: 0;
left: 0;
height: 8%;
width: 100%;
position: fixed;
text-align: center;
text-height:font-size;
}
#content{
top: 8%;
left: 0;
bottom: 15%;
width: 100%;
position: fixed;
margin: 0;
padding: 0;
overflow: auto;
z-index: 0;
}
#footer{
height: 15%;
width: 100%;
position: fixed;
text-align:center;
bottom: 0;
left: 0;
z-index: 1;
}
这非常有效,但是在内容中我有一些文本字段,并且在移动设备上,当键盘弹出页眉和页脚时,页眉和页脚也会被向上推,从而使内容字段太小。有没有办法让它们保持固定但在输入文本时不会让它们被推高?