Ari Army wrote: > Hello all, > I have a div container which has many floated images inside of it. The > images have 10px bottom and right margins, so they can space out and look > good. I noticed when I put a background color on the container that it > contains the all the images, yay which brings me to my question... > > I also though noticed the bottom margins of the floated images affected the > container, so it has 10px of space at the bottom. i dont want this. I > assumed the margins would 'pop out' since i've seen that before (when the > container or sibling div's don't contain padding/borders, i think it should > do this default so margins 'collapse' ... But not sure for floats, they may > not affect in same way). Anyway is there a way to stop the images margin > from affecting parent? > > Thanks!, > Ari
Hello Ari, please see. <http://www.w3.org/TR/CSS21/box.html#collapsing-margins> Two point from the part on vertical margins collapsing. "Vertical margins between a floated box and any other box do not collapse (not even between a float and its in-flow children)." "Vertical margins of elements that establish new block formatting contexts (such as floats and elements with 'overflow' other than 'visible') do not collapse with their in-flow children." Would the container happen to have a property that has established a block formatting contexts? <http://www.w3.org/TR/CSS21/visuren.html#block-formatting> To remove the 10px gap under the images, remove the margin:bottom. -- Alan http://css-class.com/ Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo ______________________________________________________________________ css-discuss [cs...@lists.css-discuss.org] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/