Here's a page testing the display of an image that should inherit its
width/height:
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.
[1] http://www.w3.org/TR/CSS21/cascade.html#value-def-inherit
[2] http://www.w3.org/TR/CSS21/visudet.html#the-width-property
[3] http://www.w3.org/TR/CSS21/visudet.html#the-height-property
[4] http://www.w3.org/TR/CSS21/cascade.html#q1
Actual results:
Internet Explorer 6.0: 46x40px, as expected
Firefox 1.0.4: 200x100px, the specified span dimensions
Safari (recent Panther version, forget which): same as Firefox
Opera 8.0: 100x200px, the specified div 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.
Comments?
Cheers,
--
Andrew Gregory, <URL: mailto:[EMAIL PROTECTED] >
<URL: http://www.scss.com.au/family/andrew/ >
______________________________________________________________________
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/