On 11/26/2007 4:42 AM, Phil Endecott wrote:
Quote:
Dear Experts,
It looks as if the HTML4 spec does not define a meaning for empty height
and width attributes in an IMG element. Moz seems to ignore them, while
IE7 sets the dimension to 1 pixel (or something like that).
I have a vague recollection that "" did have a defined meaning at some
point in the past, but maybe I am mis-remembering. Can anyone confirm?
I have encountered this in some third-party PHP code that I'm using on
my web site, which seems to not work for an IE7 user.
Regards, Phil. |
While the height and width attributes are recommended, they may be
omitted. I think omitting them would be better than leaving empty sizes.
The reason that these attributes are recommended is that they speed up
the rendering of a Web page. Browsers generally use these attributes to
allocate space for the image on the rendered page before the image
itself is available from the server. Without the attributes, some kind
of default space is allocated because the image's size is still unknown.
Then, when the image is available, the page must be re-rendered for the
actual size of the image.
With dynamically generated pages, however, even the image itself might
not yet known when the page starts to render. Thus, its size cannot be
predetermined for the height and width attributes.
--
David E. Ross
<http://www.rossde.com/>
Natural foods can be harmful: Look at all the
people who die of natural causes.