How do I set the height of a floating div in CSS?

Posted by indieinvader on Stack Overflow See other posts from Stack Overflow or by indieinvader
Published on 2010-06-15T21:24:14Z Indexed on 2010/06/15 21:42 UTC
Read the original article Hit count: 213

Filed under:
|
|

I have two floating divs, each is 50% wide, the problem I have is that I can't get them to stretch to the full height of the window. Essentially I want each div to have 50% width and 100% height (but it isn't working)

html

<section>
    <div></div>
</section>
<section>
    <div></div>
</section>

css

section {
    background: black;
    width: 50%; min-height: 100%; height: 100%;
    margin: 0;
    float: left;
}
section > div {
    height: 100%;
}

© Stack Overflow or respective owner

Related posts about html

Related posts about css