Last Modified: 980124
Return to
"How To" main page

Image Scaling Demos

Newly Discovered Western Carolina Rock Art Two formats are common for pictures on the Web, designated by the suffixes .gif and .jpg attached to the binary picture files. In general:

.jpg files:

.gif files:

Backgrounds: Pictures can be inserted anywhere on the page with the "img" tag. One picture can be repeated over and over to cover the whole window as a "background" by using the "background=" tag in the "body" instructions. The granite-like background on this page is an example. View the "source" text for this page to see the comands.


Image Scaling: If you don't want a picture to appear on the screen at its original size, you can resize it in a picture processor or resize it on the fly when the page loads. In this section you will learn how to resize it as the page loads.
Disadvantages: The whole image has to load whether or not it is reduced in size, so using this to make a little picture from a big one this way does not save download time.
Advantages: However this does allow you some control over the composition of the screen. Notice that the Chinese trellis at the top of this web page changes size to fit your screen (and remains centered) regardless of how you resize your window or what resolution you set your monitor for.


Here is a demonstration of simple image scaling, using the graphic that was shown above in its original size. Below are multiple copies of the same image, but for each one the image tag includes the expression width=xx%. The xx part of that is the percentage of the width of the browser window. Notice how the following proportionally scaled images change size as you resize your browser window.

As usual, to see the underlying HTML code simply view the "source" for this page.

Western Carolina Rock Art at 3% Western Carolina Rock Art at 5% Western Carolina Rock Art at 10% Western Carolina Rock Art at 17% Western Carolina Rock Art at 23% Western Carolina Rock Art at 35%



Return to top.