Use the IMG tag for inserting
a graphics image on a Web page. The
SRC attribute specifies
the image source file.
<IMG SRC="imageName"
ALT="Description of image">
imageName
is URL of the image file.
- You can link to an image file in another directory by specifying the
relative path from the current document to the linked image.
I encourage you to put your images in a separate
directory from your HTML documents, e.g., ~/public_html/images
<IMG SRC="images/dancingPenguin.gif" ALT="Dancing penguin with shades">
- You can link to an image using an absolute path name.
<IMG SRC="http://vaweb.valinux.com/~nblachman/images/dancingPenguin.gif"
ALT="Dancing penguin with shades">
The suffix of the file name should correspond to the type of image you are displaying.
- GIF
- The image name must end with
.gif
- X Bitmap
- The image name must end with
.xbm
- JPEG
- The image name must end with
.jpg
or
.jpeg
- PNG
- The image name must end with
.png
The ALT attribute lets you specify text to be displayed instead of an image or
if you move your mouse on top of the image in some browers.
<IMG SRC="imageName ALT="Description of graphic">
|