HTML
alt property
Example
An image with specified alternative text:
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.
The alt attribute can provide alternative information for an image, assuming the user cannot view it for some reason (such as a slow connection, an error in the src attribute, images disabled in the browser, or the user using a screen reader).
**Note:** When a user moves the mouse over an img element, Internet Explorer (versions before 9) displays the value of the alt attribute as a tooltip. According to the HTML specification, this behavior is not correct.
**Tip:** If you need to create a tooltip for an image, use the title attribute!
Differences between HTML 4.01 and HTML5
none.
Syntax
Attribute values
| Value | Description |
|---|---|
| text | Specifies alternative text for an image.
Guidelines for using alt text: |
HTML tag