|
Posted by GTalbot on November 10, 2007, 4:50 pm
Please log in for more thread options >
> > [followup-to set to comp.infosystems.www.authoring.html]
> > Hello fellow HTML and markup coder colleagues,
>
> > Please visit this url:
>
> >http://www.gtalbot.org/BrowserBugsSection/DefaultTopBottomMarginsForP...
>
> > I would appreciate it if someone could explain
>
> > 1- why MSIE 7 render this simple webpage so differently from Firefox
> > 2.0.0.9, Opera 9.50, Safari 3.0.3?
>
> > 2- If this is due to a bug in MSIE7? If so, which one?
>
> Clearly it is a bug. OrdinaryPargLime should have <p>'s default margins
> (usually 1.12em top and bottom, but that's up to the browser),
Hello again Ben :)
I have tried to query these default top and bottom margin values with
currentStyle.marginTop but all I got was "auto" (which can not be
resolved to something concrete, queryable from IE7) when Firefox gave
16px and Safari gave 17px when using
document.defaultView.getComputedStyle(document.getElementById("OrdinaryParg=
Lime"),
null).marginTop
document.defaultView.getComputedStyle(document.getElementById("OrdinaryParg=
Lime"),
null).marginBottom
> and
> OrdinaryPargWithMarginAutoOrange should have no margins because you set
> them to auto.
>
> CSS 2.1 10.6.3:
>
> If 'margin-top', or 'margin-bottom' are 'auto', their used value is
> 0.
Ben, this is extremely helpful info. I truly appreciate this.
> > 3- When querying the currentStyle of margin-top and margin-bottom of
> > #OrdinaryPargLime with IE developer toolbar or by querying with
> > currentStyle.marginTop, the value returned is "auto".
>
> So far so good. If the default really is auto, it should render as it
> has done-- with no margins.
>
> The first test (OrdinaryPargLime) can be considered "passed but
> suspicous"-- because we know really that <p> is supposed to have some
> default margins.
>
> > When creating a nested <p> with margin declaratively set to auto
> > inside a div with Parent-Floated-Yellow-Div class, then the top margin
> > and bottom margin suddenly occur in MSIE7 but are removed in other
> > browsers (Firefox 2.0.0.9, Opera 9.50, Safari 3.0.3).
>
> As they should be.
>
> > What I am trying to say is this: in MSIE 7, the current style values
> > of margin-top and margin-bottom for #OrdinaryPargLime and for
> > #OrdinaryPargWithMarginAutoOrange are the exactly the same: auto but
> > even for MSIE 7, those 2 paragraphs' vertical margins are rendered
> > very differently.
>
> It looks like MSIE7 is very confused.
>
> > 4- In MSIE 7, paragraphs have default margins. Why are they removed
> > (at least not visible, not rendered) for #OrdinaryPargLime ?
>
> Who knows? Perhaps it's applying the selector to the wrong <p>. If you
> delete the second paragraph altogether perhaps the first one sorts
> itself out?
If I delete the second (the orange one) paragraph, this is what I get:
When #OrdinaryPargLime is alone:
http://www.gtalbot.org/BrowserBugsSection/OrdinaryPargLimeOnly.html
When #OrdinaryPargWithMarginAutoOrange is alone:
http://www.gtalbot.org/BrowserBugsSection/OrdinaryPargWithMarginAutoOrangeO= nly.html
Regards, G=E9rard
--
Internet Explorer 7 bugs: http://www.gtalbot.org/BrowserBugsSection/MSIE7Bu= gs/
|