On May 26, 2012, at 3:19 AM, Micky Hulse wrote:

> Normally, I use padding to fix margin collapse, but I can't seem to
> figure out how to get IE7 to contain the margins of the children
> paragraphs:
> 
> <https://dl.dropbox.com/u/1277106/float-margins.html>
> 
> Here's an IE7 screen shot:
> 
> <https://dl.dropbox.com/u/1277106/float-margins-ie7.jpg>
> 
> Every other browser contains the paragraph's margins within the float.

Yeah, IE 7 and older eats the top/bottom margins of the (first-/last-) child 
element of an element that has 'hasLayout' set to true (float triggers that 
flag).

http://www.satzansatz.de/cssd/onhavinglayout.html#uncollapse


> Am I overlooking something obvious here? Is there a logic error with
> my HTML? Could it be the HTML5 document (i.e. missing a DTD that IE7
> understands)?
> 
> Is there an easy fix to get IE7 to behave the same as other browsers?

Perhaps setting some padding on the parent element (your grey boxes), only for 
IE 7 ? (my memory is fuzzy, nowadays, IE 7 is in maintenance mode, I don't pay 
too much attention to small discrepancies with other browsers).


Good, easy to understand, test case, btw, thanks for that.

Philippe
--
Philippe Wittenbergh
http://l-c-n.com/






______________________________________________________________________
css-discuss [[email protected]]
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/

Reply via email to