W3C home > Mailing lists > Public > www-html@w3.org > May 1998

RE: Are IMG height/width deprecated? Why not?

From: David Norris <kg9ae@geocities.com>
Date: Mon, 18 May 1998 04:43:47 -0500
To: <www-html@w3.org>
Message-ID: <000601bd8241$752cd740$4c4378cc@illusionary.dyn.ml.org>
I believe the term used for this is "intrinsic dimension".  It is a simple
physical description of the image.  It is explained in the CSS2 specs in
various locations.

There is a difference if you interpret it carefully.  Images are, typically,
a fixed size and that is necessary information to insert the image.  The UA
can get this information from the image itself, of course.  But, for many
reasons it seems like a generally good idea to include this information in
the markup itself.  (For a good source of reasons look around the
accessibility areas of the W3C web.)  The height and width attributes are
not for specifying what the height and width should be.  They are for
specifying what the height and width are, thus part of the description of
the image.  Such as alt, longdesc, etc.

For instance:
You have a 200px X 200px image and want to resize it to 300px X 300px in the
UA for some reason. (Note: The way the CSS2 spec reads, the UA may scale the
image to fit the content-width box.  The use of "may" implies that this
could depend on the UA or the UA's current display mode.)

Incorrect markup:
<IMG src="some.img" alt="Some picture of something." height="300"
(The image should render at 200px X 200px, even though it is stated as

Correct markup:
<IMG src="some.img" alt="Some picture of something." height="200"
width="200" style="height: 300px; width:300px;">
(The image, or at least its containment box, should render at 300px X 300px)

,David Norris

World Wide Web - http://www.geocities.com/CapeCanaveral/Lab/1652/
Illusionary Web - http://illusionary.dyn.ml.org/ <-- 02:00 - 10:00 GMT
Video/Audio Phone - callto:illusionary.dyn.ml.org
Page via mail - 412039@pager.mirabilis.com
ICQ Universal Internet Number - 412039
E-Mail - kg9ae@geocities.com

-----Original Message-----
From: www-html-request@w3.org [mailto:www-html-request@w3.org]On Behalf
Of Ian Hickson
Sent: Saturday, May 16, 1998 5:05 PM
To: www-html@w3.org
Subject: Are IMG height/width deprecated? Why not?

Nic Hughes (on the ciwah group) pointed out to me that the 'height' and
'width' attributes are NOT deprecated (in HTML4) according to the attribute
index. However, it seems to me that according to section 13.7 they *are*:

>>13.7 Visual presentation of images, objects, and applets
>>All IMG and OBJECT attributes that concern visual alignment
>>and presentation have been deprecated in favor of style sheets.
>>13.7.1 Width and height

Since 'height' and 'width' on IMG are "override" heights and widths, they
certainly seem like "attributes that concern ... presentation". The
attributes are also present in the DTD.

Is this an error in the DTD & attribute index (please say that it is!) or an
error in the text? CSS has been able to
specifiy height/width since the early CSS1 days, IMHO there is no reason for
height and width to stay.

[Note: http://www.w3.org/MarkUp/html40-updates/html40-errata.html states
that the width attribute on PRE *has* been deprecated, as does the DTD. It
does not mention IMG's width/height attributes. Other IMG attributes, e.g.
vspace, are listed as deprecated in the attribute index.]

Ian Hickson
Version: 3.12   Info: www.geekcode.com
GIT/M/S d->-- s+: a--->? C++(+++)>$ U>*++++ P L+>+++++ E(+)>+++ W+++ N(+) o?
K? w@ O- !M V- PS+ PE- Y+ PGP>+ t 5+++>++++ X- R+(+++) tv b++(+++) DI++
D++(---)>++++ G>+++ e(*)>+++++ h!()(--) !r y?
Received on Monday, 18 May 1998 05:45:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:48 UTC