Image Sizing and Scaling
Learn how to set the height and width to scale an image.

3 Dancing Penguins

You should tell your browser the size of the image, otherwise the image might cover up something in your document.

The HEIGHT and WIDTH attributes let your browser set aside the appropriate space for the image as it downloads the rest of the file.

The can be set to the same height and width as the image, in which case they are called hints.

The file command returns the type and size of an image.

file images/japengdan.gif
which returns
GIF image data, version 89a, 217 x 138

3 Dancing Penguins in Gimp Gimp shows you what the image looks like and gives you the approximate size (in pixels) of an image. See the rulers.

If the HEIGHT and WIDTH are set to values other than the image's own dimensions, they scale the image to the indicated size.

A winning hand at blackjack (21) <IMG SRC="21ok.gif"
width=130 height=151
alt="A winning hand at blackjack (21)">

Half size <IMG SRC="21ok.gif"
width=65 height=75
alt="Half size">

Wider and shorter <IMG SRC="21ok.gif"
width=150 height=75
alt="Wider and shorter">

VA Linux Systems logo

I would appreciate comments, corrections, and
suggestions for how I can improve this course.

Nancy Blachman
Variable Symbols, Inc.
356 Bush Street
Mountain View, CA 94041-1332
650 966 8999
650 966 8998 fax
nancy- at

If you want to learn how to search effectively using Google, visit Google Guide, which you can find at