Resizing images relative to window size

Hakon Lie (howcome@w3.org)
Wed, 3 Jul 1996 12:10:28 +0200


Date: Wed, 3 Jul 1996 12:10:28 +0200
Message-Id: <199607031010.MAA02695@www4.inria.fr>
To: James Aylett <sja20@hermes.cam.ac.uk>
Cc: Tom Magliery <mag@ncsa.uiuc.edu>, www-html@w3.org
Subject: Resizing images relative to window size
In-Reply-To: <Pine.LNX.3.93.960703013017.11117A-100000@crystal.clare.cam.ac.uk>
 <Pine.LNX.3.93.960703013017.11117A-100000@crystal.clare.cam.ac.uk>
From: Hakon Lie <howcome@w3.org>

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