Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML area alt property

HTML alt property

HTML area Tag HTML tag

Example

An image map with clickable areas:

Planets

usemap="#planetmap">

Sun Mercury Venus

Try it »


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the alt property.


Definition and Usage

The alt property is a required property that specifies alternate text to display when the image cannot be shown.

If a user cannot view an image for any of the following reasons, the alt property can provide alternative information for the image:

The alt property is required if the href property is used.


Differences between HTML 4.01 and HTML5

In HTML 4.01, the alt property is required.

In HTML5, the alt property is required only if the href property is used. If the href property is not used, the alt property is not required either.


Syntax

</p>
<p>text</p>
<p>

Attribute values

Value Description
text Specify alternate text for the area when the image cannot be displayed.

HTML area Tag HTML tag