Attribute references

david scotson david.scotson at gmail.com
Mon Jan 10 17:13:32 EST 2005


On Mon, 10 Jan 2005 15:57:59 -0500, Jelks Cabaniss <jelks at jelks.nu> wrote:
> Height and width attributes, expressed in pixels, are just metadata about
> the image.  Your 480x360 example is still 480x360, no matter whether you're
> using a postage-stamp sized device, a 12" 72dpi screen, a 21" 300dpi screen,
> or what have you.

Well that's sort of true if you limit yourself to using only the exact
height and width of the image in pixels, but even then it's only a
performance gain since the browser would render the image like that
eventually anyway.

On the other hand, HTML allows you to specify either or both the width
and height attributes with an arbitrary pixel dimension in order to
scale the image to that size. Alternatively you can use percentages of
the containing element too. Neither of these are metadata, but rather
presentation decisions.

<http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.7.1>
<http://www.w3.org/TR/REC-html40/types.html#type-length>

Of course using CSS you can choose from a wider range of units
including `ems` which will scale the image with the text. Thus, as I
believe Joshua Cook was suggesting, you can resize images as
appropriate to different media or situations by supplying different
CSS files.
regards,

dave scotson


More information about the Markdown-Discuss mailing list