Skip to content Skip to sidebar Skip to footer

Containing Div Not Behaving Correctly When Child Divs Are Floating

This question is related to another question I asked Basically, I have 2 horizontally aligned divs. Both sit inside a div called '.Parent', so the structure is like this:

Solution 1:

Give your #main overflow:hidden; and optionall clear:both;


Solution 2:

Actually, they ARE behaving correctly and parent divs are never to expand to contain floated elements. As shown by other answers, you can Google for "clear floats" for more explanations and examples of how to do this.


Post a Comment for "Containing Div Not Behaving Correctly When Child Divs Are Floating"