HTML img alt Attribute (original) (raw)
Last Updated : 14 Oct, 2024
The alt attribute is used to specify alternative text for an image. This attribute is particularly useful when the image cannot be displayed, either due to a broken link or when users rely on screen readers.
**Syntax
**Attribute Values
- The alt attribute contains a single value, which is a text description of the image. This description should succinctly convey the content or function of the image.
Example of img alt Attribute
HTML img alt attribute works only when the image link is broken or the image cannot be displayed, so in this example, we are showing the broken image to so the output of the alt attribute.
html `
HTML img alt AttributeGeeksforGeeks
<h2>HTML img alt Attribute</h2>
<img src="https://media.geeksforgeeks.org/wp-content/uploads/20190506164011/logo3.png" alt="GeeksforGeeks logo">
`
**Output:

**Supported Browsers:
The browser supported by _HTML alt Attribute are listed below:
- Google Chrome
- Edge 12 and above
- Internet Explorer
- Firefox
- Safari
- Opera