Thursday, September 01, 2005

Inserting Images

Images are key to interesting websites. We are visual creatures and photos and graphics add a lot to a page. There are three basic types of images used on web pages:
  • JPEG - files with the suffix '.jpg' This type of file is used most commonly for photos or graphics with gradients.
  • GIF - files with the suffix '.gif' This type of file is used for "cartoon-like" graphics–those with 256 colors or less. GIF files can also have transparency.
  • PNG - files with the suffix '.png' This type of file can cover all types of images. Supported by all current browsers, but still not in wide use.
Store all images in a special folder (usually named 'images' or 'img') inside the folder that holds your web pages. The code for placing images looks like this:

<img src="image_file.jpg">

If you put your file in the images folder (of course you did!), your code would look like this:

<img src="images/image_file.jpg">

We will learn to control the size of our images a bit later. Have fun!

0 Comments:

Post a Comment

<< Home