Beginners guide to HTMLLesson 5 - Simple Images |
GIF | Best for Line drawn pictures and simple graphics |
JPEG | Best for pictures and photographs |
Both are inserted into web pages in the same way. You need images in one of these formats to use them.
<IMG SRC="House.gif" ALT="The House" WIDTH=XXX HEIGHT=YYY ALIGN=RIGHT BORDER=B HSPACE=AAA VSPACE=BBB>
SRC="House.gif" | Source of the Image. |
ALT="The House" | A textual description of the image if possible.
If the web page makes sense without the image you can say ALT="" which means
that it has a text name, but is blank.
|
WIDTH=XXX HEIGHT=YYY | These tell the browser what size to
produce the picture. Normally these are the same as the image size, but
they can be larger or smaller to grow or shrink the image. The XXX and YYY are
numbers of pixels.
|
ALIGN=RIGHT | Aligns the picture to the right of the page likewise
ALIGN=CENTER, aligns it in the center of the page.
|
BORDER=B | If the picture is a link, this tells the browser the
width of the border to place round the image. The only really useful value
is BORDER=0 which stops it putting a border around a picture.
|
HSPACE=AAA VSPACE=BBB | These tell the browser how much space to
allow at the sides and top / bottom around a picture. Not usually required.
The AAA and BBB are numbers.
|
(Someday there will be a lesson 9 on more advanced image processing)
Updated 17th of October 2002