Alternative Text
September 17, 2005 – 1:17 pm
Why should you use the alternative text in an image? The alternative attribute of the image element? There are several reasons.
Firstly if nothing else my own remark would be for completeness. The alt attribute was invented for a reason, to provide alternative text for an image, if for some reason the image didn't load, the alternative text would be displayed instead. It is an attribute for a very good reason and therefore should be there to create complete code instead of a half done page.
However, that's just my feeling on (X)HTML coding and that if a tag is still used and in circulation then use it (if appropriate) along with its attributes where ever required.
Secondly, and one of the more better reasons, is as mentioned before, if the image does not display for any particular reason then the alternative text will be displayed instead. Reasons for an image not displaying? There are many. Someone may have turned their images off for browsing, remember not everyone has broadband access, and even I have broadband yet sometimes it goes so slow that I turn the images off (yes it goes that slow!). Perhaps the download cut at a point and the image wasn't downloaded. A slight blip in the download and suddenly your visitor is faced with a page of text, no images and no knowledge of what those images represented.
Reason three is the most important reason. Not everyone who visits your page will necessarily be able to see the page clearly. Partially sighted and blind visitors still have the right to visit web pages, using screen readers to dictate the information to them. However a screen reader cannot read what an image should be therefore uses the alternative text and the title attribute (if used) to explain what the image is. If there is no alternative text there the visitor cannot know what the image is about or it's purpose on the page. At this point can I mention that if you have, or are developing, a business site you need to ensure that every part of your website is accessible for your disabled visitors otherwise the repercussions could be worse. The only current case known where a web site owner has been successfully sued for an inaccessible web site was that of Maguire vs. SOCOG, concerning the lack of accessibility on the Sydney Olympics web site.
Number four is for validation of your pages. A well coded page will have a document type delcaration at the top of it, and this will then allow a HTML Validator to validate your code. If your images are missing the alt attribute then this will be shown as an error. If you have no text for an image, such as a bullet point, then replace it with something appropriate, such as an asterisk *. The validators realise that some images have no other alternative, and in theory are just there to make the visual site look nice, but you need to let people realise this otherwise they will be left wondering what should be there.
And the last reason that I can currently write about is Search Engine Optimisation (I bet you wondered when I'd get to that!). Spiders do read the alternative text of an image. They cannot read the image themselves, so they have to read the file name and the alternative text. Therefore an image with a filename of img001.gif and no alternative text is no help to you whatsoever. At this point can I just mention, don't start using what's referred to as keyword stuffing in all of your alt attributes. That's no help to your visitors, screen readers, and spiders will start to catch on to this type of spam too. Name your image as it should be named or represented. Use the title attribute to elaborate if necessary. There has been some speculation as to whether alternative text has any benefit to SEO. More weight is put on the text when the image is linked. As with normal text, linked text is more important to a spider. However unlinked images will still be spidered, and their alternative text will still pull in visitors. The best example of this is my own business site 3.E.Media. This has a different fruit or vegetable picture in the top right corner of every page. Out of search engine phrases that bring visitors to my web site, quite a few are for phrases such as "strawberries" or "bunch of grapes" etc. These images are not linked, they are at the bottom of the HTML code (the style sheet moves them to the top right), and those words are not mentioned anywhere else on the screen! So I think my statistics prove the point that alternative text should be used, used in the correct manor and you never know who you may get to your site.


Sorry, comments for this entry are closed at this time.