HTML Attributes
HTML alt attribute
Provides a textual alternative for an image, image submit control or linked image-map region. On decorative images use alt=""; on functional images describe the action. Do not substitute a filename. Applicable elements include: <area>, <img>, <input>. Check each element’s value rules. Example uses illustrative URLs or local assets; provide the corresponding files or application endpoints when running it.
Formal Syntax & Structure
html syntaxhtml
alt="Snow-covered mountain at sunrise"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| alt | text | Provides a textual alternative for an image, image submit control or linked image-map region. On decorative images use alt=""; on functional images describe the action. Do not substitute a filename. |
Working Example
Example Snippethtml
<img src="mountain.jpg" alt="Snow-covered mountain at sunrise" width="320" height="180">Browser Compatibility
Minimum supported versions across modern rendering engines
Blink (modern)
Chrome
1
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
1
Yes
WebKit
Safari
1
Yes
Desktop support for alt on image-type input; not a matrix for img or area.
HTML Living Standard