The alternative text (
alt) attribute provides a text-only description of an image.
Using the image for the Motive logo as an example:
<img src="/img/logo.gif" alt="Motive logo" />
If this webpage were viewed without images, then the Motive logo image (top left) would be replaced with the text:
alt textis used
The alt attribute value (
alt textin generating search results;
Although a person can recognise an image on a webpage as ‘a coffee cup’, ‘my vacation pics’, or ‘a potted palm’; a computer program can only ‘see’ that the webpage is linking to an image file.
For example, let’s say that one of the images mentioned above has the file name:
DSC_6400.JPG. The only view that a computer program has of the image is the HTML code, which might look something like this:
<img src="DSC_6400.JPG" />
Based only on the code, the computer program knows that it is dealing with an image
<img...>, and might guess that the image is a photo – as JPEG files (using the file extension
.JPG), are used in digital cameras – but it can’t tell if this file is the photo of the cup, the West Coast beach, or the plant.
alt text gives a computer program another way of figuring-out what is in the image.
<img src="DSC_6400.JPG" alt="coffee cup" />
Now the computer knows:
The more information you provide about an image, the more ways that a computer program is able to help other people find, or use that image. For example:
alt textto help a person find your product, service or event;
alt textto describe the image to someone with a visual impairment.
Alt text is commonly, but inaccurately, referred to as an alt tag. For clarification see: elements, tags.
<img src="imagename.gif" alt="" />
alt text, then a screen reader will typically read out the file name.
alt text(in English).
altattribute for each hyperlinked area (hotspot).
The New Zealand Government Web Standards and Recommendations sets out the requirements that New Zealand public sector websites must meet to make web-based information and services available to the widest possible audience. …
altattributes smartly (Google)