[whatwg] <img> element comments

Matthew Raymond mattraymond at earthlink.net
Fri Nov 3 19:12:15 PST 2006


Michel Fortin wrote:
> Except that, contrary to bgcolor, the height and width attributes can  
> help solve a real problem: page jiggling while the images loads. It's  
> somewhat like the type="image/jpg" attribute you can set for links:  
> it gives advance information on what the external content is supposed  
> to be.

  So does CSS, as you point out below.

> In this case, height and width are inherent properties of the  
> document if we consider the linked image as part of the document,  
> much alike the type="" attribute on a link.

   I'm not sure what you mean. The |type| attribute describes the MIME
type. Even if you were to deliberately manipulate this value to some
end, I don't see how you could do so in a way that alters the
presentation of the document like |height| and |width| do, with the one
exception being that you can prevent a style sheet from loading by
intentionally giving the wrong |type| value. Of course, there's no
obvious motive for providing a <link> that does nothing, is there?

> Sure, we could use
> style="width: 32; height: 32" instead of width="32" height="32", but  
> most of the time the size of an image isn't a matter of style, it's a  
> matter of what the image is.

   The |width| and |height| attributes don't specify the dimensions of
the source image. They specify the size of the image in the document.
That's presentational, in my book. Arguing that those attributes are
properties of the image within the document amounts to a free pass for
all presentational markup. The <font>, <center>, <s> and <u> elements
communicate a property of the text, not the presentation. I don't buy
it. Without the attributes actually describing a property of the source
image (which is redundant), the |height| and |width| have no semantic
meaning. Convenient as they are, they're styling as markup.



More information about the whatwg mailing list