Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is alt="" appropriate in some situations for html img tag?

We have a project that is all about web accessibility compliance. About a week from launch we have the accessibility committee reviewing our site to give the final thumbs up. However, they reported back to us that we should set alt="" on some of our icons because they do not provide any additional content to the site and thus are merely distracting to a screen reader but yield no benefit.

  1. Is this correct?
  2. I was under the impression alt was a required attribute of img? Sure alt="" on an img tag would include the alt attribute but is this valid ?

Comments are appreciated.

like image 260
Chris Avatar asked Sep 27 '10 17:09

Chris


Video Answer


2 Answers

If the icons provide any functionality (user-clickable or something), I'd recommend setting a descriptive alt value. If they are just decorative, then alt="" is valid.

From the standard:

While alternate text may be very helpful, it must be handled with care. Authors should observe the following guidelines:

  • Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt="red ball" would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string (""). Authors are in any case advised to avoid using images to format pages; style sheets should be used instead.
  • Do not specify meaningless alternate text (e.g., "dummy text"). Not only will this frustrate users, it will slow down user agents that must convert text to speech or braille output.
like image 137
naivists Avatar answered Nov 05 '22 17:11

naivists


According to this source: http://msdn.microsoft.com/en-us/library/ms228004(v=VS.100).aspx#guideline_11__providing_alternate_text_for_images omitting alt attribute would make some sreen readers pronounce the file name and distract the user, which is why setting alt to an empty string is recommended.

like image 39
Nemanja Trifunovic Avatar answered Nov 05 '22 16:11

Nemanja Trifunovic