HighDots Forums  

Re: Nested floated divs

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Re: Nested floated divs in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ben C
 
Posts: n/a

Default Re: Nested floated divs - 10-07-2007 , 08:02 AM






On 2007-10-07, Ben C. <ben (AT) example (DOT) net> wrote:
Quote:
Hi

If I have a container div and inside the container div I float two divs
(one left and one right), the containting div will collapse as the
floated divs will no longer prop it up, meaning that any background
colour or image on the containing div will not be visible.

Now, suppose I put left and right padding on the containing div. How
come, if the containing div has collapsed, does the padding of the
container still apply to the two nested floated divs?
The container still has all its padding. Its top, left and right padding
will be above, to the left and to the right of the floats inside.

It's just that its auto height calculation (if it has auto height)
doesn't take account of the floats.

Quote:
It seems as though the floated divs are 'inside' the container in some
ways, but not inside the container in other ways (they don't prop it
up). Is there some simple way to think of this so it all makes sense?
The explanation you've given is OK-- they start inside but end outside.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.