bikey77
bikey77

Reputation: 1

Make container DIV cover 100% of containing DIV's height

I'm working on a new website and on one my pages I just cant get my #main div which is my page content's containing DIV to stretch long enough to cover the inner DIV's.

Please check it out and point out the parts of my CSS that need fixing. Many thanks to all.

Upvotes: 0

Views: 2525

Answers (2)

egis
egis

Reputation: 1412

Just remove height: 100% from layout.css at #main{...} (line 31 or so) and add <br style="clear:both;" /> after <div id="content">...</div>

Upvotes: 1

sandeep
sandeep

Reputation: 92803

@bikey; just right

#main {
    background: none repeat scroll 0 0 #101010;
    border-color: #333333;
    border-style: solid;
    border-width: 1px 1px 0;
    margin: 15px auto 0;
    overflow: hidden;
    padding: 20px;
    width: 920px;
}

The problem is in your #main div there are floated element's so you have to clear it first. in the example above i write overflow:hidden & remove height:100%

Upvotes: 2

Related Questions