HTML alt property
Example
An image map with clickable areas:
usemap="#planetmap">
Try it »
Browser support





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 network connection is too slow
- An error in the src property
- The browser has images disabled
- The user is using a screen reader
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
Attribute values
| Value | Description |
|---|---|
| text | Specify alternate text for the area when the image cannot be displayed. |
HTML tag