You are here:
- Manual
- Development
- Images
- The
altattribute
Images and alternate text: The alt attribute
The alt (alternative) attribute is one of the requisite attributes on the img (image) element. It can also be applied to the area element (for image maps) and the input element (when using images as form buttons).
The alt (alternate) attribute should be used on every img (image) and area element and should be provided with an effective alternate text.
Guideline R-pd.7.1
When an alt attribute is applied to one of the elements above, its value (the alternate text – also called alt-text) is shown instead of the image if the image is not shown.
The alt attribute is also known as the alt tag. Although technically speaking an attribute is not a tag, the term has become well known.
Requisite use on images
According to the W3C HTML4.01 specification use of the alt is required on the img and area element, even if the decision has been made to assign an empty value to the attribute. See also Writing effective alternate text.
Image with an alternate text (HTML)
<img src="/images/contact.gif" alt="Contact">
Writing effective alternate text
An effective alternate text is a text that can be read instead of the image so that the function of the image. Thus the informational value of the image is maintained.
The alt attribute and tooltips
The alt should not be used to present tooltips. If the web developer or content manager wants to present a tooltip for the benefit of the visitor, he should use the title attribute.
