HTML Reference

The <img> Tag

The <img> is used to display graphics on a web page. The following table lists the attributes associated with the <img> tag:

AttributeDescription
src=urlThe src attribute specifies the source of the image, where url is the url of the image; for example, src="myimage.gif" would place myimage.gif on the page. NOTE: This attribute is required.
alt=textA short label for the image. This should always be set. It will show on browsers that don't display images, for example.
height=pixelsSets the height of the image in pixels. The image will be scaled appropriately.
width=pixelsSets the width of the image in pixes. Again, the image will scale.
border=pixelsWill place a border around the image the number of pixels specified wide. This attribute is deprecated, and one is encouraged to use styles instead.
align=[left | right | top | middle | bottom]Describes how to align the image with respect to the surrounding text.This attribute is deprecated, and one is encouraged to use styles instead.
hspace=pixelsHow much white space to include on the sides of the image in pixels.
vspace=pixelsHow much white space to include on the top and bottom of the image in pixels
longdesc=urlPoints to the url of a document containing a long description of the image.
ismapSee <map> and <area> tags for details.
usemapSee <map> and <area> tags for details.