必要な場所に到達するための古い学校のハックがあります。
次のようなものと仮定しましょう。
<div id="container"> // Give it overflow: hidden;
<div id="maincontent">
Your main content goes here // Assumes this is always taller than sidebar
</div>
<div id="sidebar">
This is your sidebar stuff // Give it a height of something like height: 16000 px;
</div>
</div>
<div id="footer">
This is your footer stuff
</div>
この方法を使用すると、サイドバーは常にすべての中で最も高くなりますが、CSS でサイドバーが隠されているオーバーフローがあるため、サイドバーは「メインコンテンツ」DIV と同じ高さしかありません。
パート2:
OK、ハックに問題が見つかりました。重要な部分を忘れていました。
サイドバーは忘れてください: height: 16000px;
padding-bottom: 5000px と margin-bottom: -5000px; が必要です。// または任意の値。負の数を除いて、margin-bottom は padding-bottom と同じサイズでなければならないことを覚えておいてください