The alt attribute is used as a textual representation for graphics and buttons in browsers that don't or can't render images, or when the resource is not found.
The alt tag is required for images and image buttons. It should provide a concise label for the element it is being applied to, for the case that a user is visually disabled or is using browser that doesn't render images.
The alt tag text should be displayed in place of the image if the resource is not found. When hovering over the element, the alt text will display in a tooltip.
For images, it should describe what the image represents. The contents of an alt tag should use general, non-visual language to accommodate non visual users. For example, a picture of a lake intended to evoke an emotion should have text more descriptive than "Lake" or "Clear, blue lake". "Breathtaking open lake" may be more appropriate.
If an image is not intended to be part of the content of the page, but instead is purely functional or aesthetic, the alt text can be an empty string. This case could apply for an image used as a border or spacing element.
This example uses the 'alt' attribute to indicate that the icon displayed denotes a read/write property.
<!doctype html> <title>Image alt attribute usage</title> <img src="http://example.com/path/to/no.jpg" alt="No image, so here is the alt text">
|Feature||Chrome||Firefox (Gecko)||Internet Explorer||Opera||Safari|
|Basic Support||Beta||1||3|| 3
|Feature||Android||BlackBerry||Chrome for mobile||Firefox Mobile (Gecko)||IE Mobile||Opera Mobile||Opera Mini||Safari Mobile|
This article contains content originally from external sources.
Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]