У меня есть три элемента div
: один как заголовок, один как нижний колонтитул и содержимое центра div
.
в центре div
в центре нужно автоматически расширять содержимое, но мне бы хотелось, чтобы min-height
, что нижний div
всегда, по крайней мере, доходит до нижней части окна, но не фиксируется там дольше страницы.
Например:
<div id="a" style="height: 200px;">
<p>This div should always remain at the top of the page content and should scroll with it.</p>
</div>
<div id="b">
<p>This is the div in question. On longer pages, this div needs to behave normally (i.e. expand to fit the content and scroll with the entire page). On shorter pages, this div needs to expand beyond its content to a height such that div c will reach the bottom of the viewport, regardless of monitor resolution or window size.
</div>
<div id="c" style="height: 100px;">
<p>This div needs to remain at the bottom of the page content, and scroll with it on longer pages, but on shorter pages, needs to reach the bottom of the browser window, regardless of monitor resolution or window size.</p>
</div>