Hypertext Links
Image Formats
Text Formatting
Forms
Tables
Stylesheets
Databases and ASP
   


Image element

The <IMG> element is commonly used to insert images into web pages. Most browser are equipped to handle Gif and Jpeg format.

For example:

<IMG SRC="http://www.koodesign.co.uk/images/logo19_r2_c1.gif" height="36" width="199" border="0" alt="koodesign" >

or

<img src="../../images/logo19_r2_c1.gif" width="199" height="36" width="199" border="0" alt="koodesign">

where SRC defines the source or URL of the image and it can be specified as absolute or relative path.

koodesign

Align

This attribute is used to align the image within the page or table cell. It can be added to a paragraph tag for example:

<p align="center"><IMG SRC="http://www.koodesign.co.uk/images/logo19_r2_c1.gif" height="36" width="199" border="0" alt="koodesign" ></p>

koodesign

ALT

This attribute defines alternative text for the image.Some applications cannot display graphics or Sometimes users turn off the images to speed up the loading and they will be able to see what each image represents from the alt tag:

<IMG SRC="http://www.koodesign.co.uk/images/logo19_r2_c1.gif" height="36" width="199" border="0" alt="koodesign" >

koodesign

BORDER

Defines the width of the border around the image in pixels.

<IMG SRC="http://www.koodesign.co.uk/images/logo19_r2_c1.gif" height="36" width="199" border="3" alt="koodesign" >

koodesign

HEIGHT AND WIDTH

Defines the width and height of the image in pixels:

<IMG SRC="http://www.koodesign.co.uk/images/logo19_r2_c1.gif" height="36" width="199" border="3" alt="koodesign" >

By adding the height and width to the <IMG> element the page will load faster (Browser will know the exact size of the image).

HSPACE AND VSPACE

Defines the space around the image. For example:

koo
Hspace="10" and vspace="10" values are in pixels

<img src="pp.gif" width="163" height="82" vspace="10" hspace="10" align="left" border="0" alt="koodesign url">

LOWSRC

Lowsrc attribute: Because some image files take so long to download, LOWSRC was created to download a smaller image (low resolution) first before the "main" image (full resolution) is downloaded.

<IMG
SRC="/images/pp.gif"
LOWSRC="/images/pp2_lowsrc.gif"
HEIGHT="163" WIDTH="82" ALT="koodesign URL">

[1]---[2]

Copyright © 2001 koodesign