![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Browsers affected: IE6, IE7, FireFox 2.x, Safari Because all of the browsers are rendering this the same way, I tend to believe it's not a bug but rather I just "don't know the rules" for how things are supposed to be rendered. The problem is that an child (inner) div's margin is ignored if there is nothing in its parent (outer) div other than itself. If the parent div has a border applied, suddenly the margins are rendered. Why is this? Once again, there must be a reason since all browsers are doing it. Please, help me understand! Here's a VERY simple page that illustrates my issue: http://dev.digitolle.net/test/cssidiocy.htm |
#3
| |||
| |||
|
|
Browsers affected: IE6, IE7, FireFox 2.x, Safari Because all of the browsers are rendering this the same way, I tend to believe it's not a bug but rather I just "don't know the rules" for how things are supposed to be rendered. The problem is that an child (inner) div's margin is ignored if there is nothing in its parent (outer) div other than itself. If the parent div has a border applied, suddenly the margins are rendered. Why is this? Once again, there must be a reason since all browsers are doing it. Please, help me understand! Here's a VERY simple page that illustrates my issue: http://dev.digitolle.net/test/cssidiocy.htm |
#4
| |||
| |||
|
|
In article 1186447705.670631.12... (AT) e9g2000prf (DOT) googlegroups.com>, Shadow Lynx <shdwlynxj... (AT) yahoo (DOT) com> wrote: Browsers affected: IE6, IE7, FireFox 2.x, Safari Because all of the browsers are rendering this the same way, I tend to believe it's not a bug but rather I just "don't know the rules" for how things are supposed to be rendered. The problem is that an child (inner) div's margin is ignored if there is nothing in its parent (outer) div other than itself. If the parent div has a border applied, suddenly the margins are rendered. Why is this? Once again, there must be a reason since all browsers are doing it. Please, help me understand! Here's a VERY simple page that illustrates my issue: http://dev.digitolle.net/test/cssidiocy.htm To see better what is going on, try adding to your .outer a bit: background-color: red; border: 100px solid green; -- dorayme |
#5
| |||
| |||
|
|
Shadow Lynx wrote: Browsers affected: IE6, IE7, FireFox 2.x, Safari Because all of the browsers are rendering this the same way, I tend to believe it's not a bug but rather I just "don't know the rules" for how things are supposed to be rendered. The problem is that an child (inner) div's margin is ignored if there is nothing in its parent (outer) div other than itself. If the parent div has a border applied, suddenly the margins are rendered. Why is this? Once again, there must be a reason since all browsers are doing it. Please, help me understand! Here's a VERY simple page that illustrates my issue: http://dev.digitolle.net/test/cssidiocy.htm See in the Specifications regarding "collapsing margins": http://www.w3.org/TR/CSS21/box.html#collapsing-margins http://www.w3.org/TR/CSS21/box.html#mpb-examples URL's which explain the why and wherefore of "collapsing margins". CSS - Auto-height and margin-collapsing http://www.researchkitchen.de/blog/a...ght-and-margin... No Margin For Error http://www.andybudd.com/archives/200...rror/index.php Uncollapsing Margins http://www.complexspiral.com/publica...psing-margins/ An easy way to confirm if a problem is due to collapsing margins is to include this temporarily in your stylesheet: * {margin:0 !important;} -- Gus |
![]() |
| Thread Tools | |
| Display Modes | |
| |