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 User221415-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.

Updated on 15-Jun-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By