Jeroen Coumans wrote:
> http://jeroencoumans.nl/test/border.html
> http://jeroencoumans.nl/test/no-border.html
> 
> ... And even more dubiously, Internet  
> Explorer seems to do the correct thing - the positioning shouldn't be  
> affected by the presence of a border, so both files should be  
> rendered the same. 

Els already answered this, I'd like to add why IE does it wrong.

Margins do not collapse when they are not adjoining due to a border or a 
padding. This is why the given files do not render the same, which is 
correct.

Block formatting contexts (float, overflow, position:absolute, 
display:table-..), do prevent margin collapsing, too.

The bug in IEx-7 is that "layout" establishes a new block formatting 
context and prevents margin collapsing [1]. And body is a default 
"layout" element in IE, like td or iframe.

Since there is no way to "un-layout" default layout elements in IE, and 
non-layout parents would be usually too instable to hold complex 
designs, or simply fail to work correctly: The only cross-browser 
workaround is to prevent margin-collapsing in the more 
standards-compliant browsers, by using padding, border, or by 
establishing a new block formatting context.

Ingo

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

-- 
http://www.satzansatz.de/css.html
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to