Div with a height of 0px, it does not grow in relation to its children

I have a div div.home-topwith two other divs div#home-contentlike float:leftand div#home-buttonshow float:right.

And below div#home-topgot div#home-footerhowclear:both

Mine div#home-topis the minimum size. I put it in red, but I do not see it. How to make div#home-toptake on the height divs of children. See the code.

+3
source share
2 answers

Add overflow: hidden;to CSS for div#home-top:

div#home-top
{
    background-color:Red;
    overflow: hidden;
}

JS Fiddle demo

+11
source

Floating divs have no height, so .home-top does not expand. You will need to give it an explicit height or expand its internal elements.

+2
source

All Articles