考慮下面的HTML之間的空隙填充:需要股利兩個div
<div id="wrapper">
<div id="header">*header*</div>
<div id="content">*content*</div>
<div id="footer">*footer*</div>
</div>
下面CSS:
#wrapper {
min-height:100%;
position:relative;
}
* {margin:0;padding:0;height:100%;}
#header {
width:100%;
height:auto;
margin-top: 0;
}
#content {
width:100%;
height: auto;
margin:0;
margin-top:0;
margin-bottom:0;
}
#footer {
width:100%;
height:auto;
position:absolute;
margin-top: 0;
margin-bottom: 0;
bottom:0;
left:0;
}
還有就是內容和頁腳DIV之間的間隙。我如何設置內容的高度必須是頁眉和頁腳之間的所有空間?
頁腳必須具有「絕對」位置才能位於頁面的底部。
免費小提琴 - HTTP://的jsfiddle。淨/ Jfsak/1 / – Arkana