Users Pricing

forum

home / developersection / forums / making main section of a page fill the remaining height with css only

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

Anonymous User 2589 15 Jun 2013
Hi Expert,

I have created two div as following

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

<div class="main">
    Hello world
</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.

I am a content writter !


1 Answers