Users Pricing

forum

Home Forums Making main section of a page fill the remaining height with CSS only – MindStick

Making main section of a page fill the remaining height with CSS only

Anonymous User 2652 15 Jun 2013
Hi Expert,

I have created two div as following

<div class="header">
    <h1>My Cool Site</h1>
</div>

<div class="main">
</div>

The header div should take up as much space it needs. The main div should fill the remaining page height exactly - a scroll bar should not appear. Is this possible to do with CSS only? No JavaScript.

Thanks in advance for any recommendations or solutions.

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md