When NOT to use the alt attribute
- Published February 7th, 2008 in Web/W3C, Tips & Tricks, Usability
If you're using doctype XHTML 1.0 Strict you should know by now that the use of the alt attribute is mandatory on img tags. The reason being that screen readers use the alt attribute to explain to the user what that image might mean.
The problem arises when you're using images as decorative elements, like having a star on a title that says "Rating". If you fill the alt attribute of that star you'll cause the screen readers to say "rating" twice (or whatever you wrote on the star that you think it makes sense). This is definitely very annoying.
So, in order to still comply with XHTML 1.0 and give your users some fancy titles you'll have to leave the alt attribute empty. For instance:
Of course this only applies when using icons or images as decorative items.




Oh, I think it’s worth mentioning what happens when you don’t include an alt attribute:
“(…) Don’t omit it. If you do, some screen readers will read the image’s file name, and text-only browsers like Lynx will display the image’s file name. This is rarely useful to your visitors.(…)”
in http://www.456bereastreet.com/archive/200412/the_alt_and_title_attributes/
Also, if you’re using CSS for layouts ,you should have to deal with very few tags without a proper alternative text.
Good issue to bring up, Mário. :)
Thanks for the insight André :-)