In the event that the user
cannot view the image you’ve used—perhaps because he or she is using a
very slow connection, you’ve included an incorrect
attribute, or because the user is visually impaired and is accessing the
content using a screen reader—the
provides alternative information, as Figure 1 shows (that screenshot taken from
IE6 on Windows XP).
alt attribute should be
considered to be required when the
is set to
"image", although that requirement cannot be
expressed in an SGML DTD (hence, this isn’t shown as a required
attribute—it depends on context).
This code shows the
alt attribute for a form’s image submit
<form> ⋮ <input type="image" src="submit.jpg" alt="Submit your details"/> </form>
The attribute value comprises text that’s equivalent to the content of the image. As such, the text should state clearly the effect of pressing the button (or image).
support is provided for
alt, but Safari and Chrome
don’t display suitable alternative content when the image fails to load
(they simply display a rather unhelpful question mark or broken image