私のメインディビジョンが内容に不足しているときに、私のフッタを下に保つのに苦労しました。しかし、私はそれを固定フッタのトリックで修正しました。しかし残念なことに、私のメインディビジョンがコンテンツに不足しているときにフッタに至るまで、この問題が残ります。メインdivの下端+フッタがビューポートよりも小さい場合、余分なdivを空のスペースに追加することでJSでこれを修正しました。しかし、私は非jsユーザーをサポートしたいので、これはもうオプションではありません。ページのフッター/ボトムへの相対的なdivの伸縮
html, body {
height: 100%;
background-color: #678dae;
margin: 0px;
padding: 0px;
}
#wrap {
min-height: 100%;
}
#main {
width: 70%;
/* I need them to be centered like this because my div is being resized from time to time */
margin-left: auto;
margin-right: auto;
overflow:auto;
padding-bottom: 150px;
background-color: #fff;
}
#footer {position: relative;
\t margin-top: -150px; /* negative value of footer height */
\t height: 150px;
background-color: #333;
\t clear:both;
}
<div id="wrap">
\t <div id="main">
\t \t <div id="content">
<p>Div content</p>
<!-- <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> -->
\t \t </div> \t
\t </div>
</div>
<div id="footer">
<p>Footer content</p>
</div>
[CSSの最小限の高さでページの下部にHTMLページのフッターを維持する]の可能な複製](http://stackoverflow.com/質問/ 643879/css-to-make-html-page-footer-stay-the-bottom-of-the-a-minimum-height-height) – noahnu