Page is a not externally linkable
- Code, Content, and Presentation
-- CSS
---- Divs inside divs


Xapti - 6:00 am on Sep 29, 2007 (gmt 0)


the reason your container div is collapsing is because both the contained divs are floated. floated elements do not count for calculating stuff like height and such. One of the simplest ways is to add another element (any element, you should probably make it height:0px or something) with the property of clear:both on it.

another option is to add the container div style "overflow:auto", which (I don't know in detail why) also fixes the problem, but with some exceptions. IE needs haslayout for it to work I think, so find a method to add haslayout. zoom:1 works as long as you don't mind ousting IE5 (cause it doesn't support it, or am I getting mixed up?) or something. Assigning width and stuff works too.


Thread source:: http://www.webmasterworld.com/css/3464380.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com