HTML

Home

Tutorials

Go to tag:

 

Name

Image

Description

Shows an image on the page.

Attributes

ALIGN

Specifies the horizontal alignment of the image.  The possible values are:

Value
bottom
left
middle
right
top

ALT

This tag shows a description of the image if the user has disabled images in their browser or if the image was not found.  In Internet Explorer, this text is shown when the mouse if hovered over the image.

BORDER

Sets the size of the border around the image, in pixels.

HEIGHT

Sets the height, either as a pixel value or a percentage.

SRC

Specifies the image's URL.  To show to an image on the same site use the local path e.g. src="button.gif" or src="folder/photo1.jpg".  You can also use dots to link to an image in the parent folder e.g. src="..\diagram.png".  To show a picture from another site, use the full URL e.g. src="https://www.martin2k.co.uk/html/escortgti.jpg".

TITLE

Displays text when the mouse is hovered over the image.

USEMAP

Defines the image as an image map.  See the AREA and MAP tags.

WIDTH

Sets the width, either as a pixel value or a percentage.

Example

Code

<img src="https://www.martin2k.co.uk/html/escortgti.jpg" alt="1998 Ford Escort GTi" border="2" title="1998 Ford Escort GTi" width="300" height="225">

Generates

1998 Ford Escort GTi
© Martin Allen 1999 - 2017.  Last updated Monday 18 December 2017 22:26 +0000.