Reputation: 15459
example:
Html
<div id = parent>
<div class = "clearDiv"></div>
</div>
css:
div.clearDiv
{
width: 1000px;
height: 1px;
float: left;
clear: both;
visibility: hidden;
}
with the float: left
property specified, its parent div does not recognize it, the therefore the parent div #parent has a height that is pretty much zero, why?
Upvotes: 1
Views: 251
Reputation: 105029
Set overflow:auto;
CSS style to parent container element.
To parent container they don't provide dimensinal infomation. They just interact with their siblings (or other floated elements). Hence float. They can be anything, anywhere and of any size. Container doesn't really care because they're floating...
Upvotes: 3