Andrew Gregory schrieb:
http://www.scss.com.au/family/andrew/webdesign/test.html
Expected results (correct me if I'm wrong):
* The image should inherit the computed height and width of its parent,
the span [1].
* Width and height do not apply to inline elements (the span), so the
computed width and height of the span should be "auto" [2, 3].
* It's those computed values that should be inherited by the image [4].
* An auto width and height on the image should result in it being
displayed in its native 46x40 pixel dimensions.
...
It seems Firefox and Safari are correctly ignoring the height/width of
the span when displaying the span, but are not correctly calculating
the values to "auto" (which would then be inherited).
Opera appears to be pretending as if the height/width were never
specified on the span in the first place, then it looks like it skips
over unspecified properties for the purposes of inheritance, and
therefore ends up inheriting the *grandparent* element (div)
width/height to the image.
I had a look at these specs too the other day someone posted a "test
case" on that Opera forum ("Opera vs Firefox: serious discrepancies"),
* {
width: inherit;
height: inherit;
padding: inherit;
margin: inherit;
color: inherit;
}
and the person was wondering why, after all his work with this layout,
the browsers show different, sometimes horrible results.
I thought of this is a horrible rule, because browsers have slightly
different interpretations of the specs that aren't sooo clear imho: For
me, the expected result you are asking is that this rule will break the
layout in a horrible manner.
(The next thing he used on his test case were positioning with
fractional percentages, know to be buggy/inconsistent/rounded in most
browsers. Together, this makes his layout unfixable.)
I think Opera just ignores the width setting of the span and inherits
the width from the grandparent. Moz ignores the width of the span too,
but calculates the inherited width of the image with respect to the
"ignored width" of the span. Would "ignoring" mean: completely drop the
width (Opera) or just not assign it to the span (FF)?
I find your question and your interpretation reasonable, but cannot
answer. I think the answer, if one was found, wouldn't help this person,
because he would have to rethink his layout from the beginning anyway.
Ingo
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/