Resizing images relative to window size

James Aylett writes:

 > My initial reaction was
 > "How do I scale down the page?", but after a while I decided that what I
 > really wanted to do was scale the images with respect to the page width -
 > ie, in a similar way to using <TD WIDTH=50%> I'd have <IMG ... WIDTH=50%>
 > for each.

This can easily be expressed in CSS [1]:

  <IMG .. STYLE="width: 50%">

The percentage refers to the parent element's width which will be
closely related to -- if not the same as -- the page width.

Microsoft's Internet Explorer [2] has initial support for CSS, but the
above has probably not been implemented yet.

Using CSS, one can set the width on any element. CSS does't specify
how the scaling is to be performed since different media types scale
differently. E.g., a text element should scale differently from an
image element.

[1] http://www.w3.org/pub/WWW/TR/WD-css1
[2] http://www.microsoft.com/IE/htmlext/default.htm

Regards,

-h&kon

Hakon W Lie, W3C/INRIA, Sophia-Antipolis, France
http://www.w3.org/people/howcome  howcome@w3.org

Received on Wednesday, 3 July 1996 06:11:30 UTC