|Does it really hurt if I skip the alt on graphics like these? |
All images (and other elements that require it) must have an alt attribute. If the image does not require an alternative representation (alt text), use an empty alt attribute like this...
<img src="file.gif" width="100" height="100" alt="">
That's two quote marks side by side.
What I've found over the years is that when you design with CSS and minimize/eliminate the use of tables, you effectively reduce your code bloat by eliminating the need for all of those spacer gifs that do require an empty alt attribute to pass validation.
|BTW what is utf-8 and where is it supposed to be on the page? |
Character encoding, entity references and UTF-8 [webmasterworld.com] from WebmasterWorld library [webmasterworld.com]:
In order to overcome the hodge-podge of incomplete, conflicting and aging standards (the ISO-8859 series date from the early 1980s), the notion of Unicode was developed.
By far the most important Unicode version on the web is UTF-8. This standard have numerous advantages, the most important of which is that it remains compatible with the much earlier US-ASCII standard. In fact, all of the single-byte ASCII characters are represented in exactly the same way in UTF-8. Only extended characters are different, made from multi-byte strings defined for each character, whether an e acute, an oe ligature, or characters from Arabic, Russian, Urdu or Japanese.
UTF-8 is especialy important for XML as it is the default encoding for all XML documents. And as you can't use HTML entity references and earlier ISO-8859 standards are incomplete, UTF-8 is the only logical choice when dealing with XML formats such as RSS or Atom which, even if you are only using English, are more than likely to eventually need more than the basic ASCII charset can offer.
UTF-8 is incredibly useful in HTML/XHTML too - no more entity references, the possibility to use extended characters such as curly quotes or long dashes, the possibility of using one charset across a multi-lingual site.
If you leave off the
alt attribute for an image, most screenreaders will announce the file name of the image in a final attempt to confer something meaningful to the end user. So you can get endless spoken references to "spacer.gif" or "logo.jpg" making the page very tiresome to read.
When you use an empty
alt attribute as described by pageoneresults, the screenreader knows that there is no particular meaning to the image, and the image is skipped. It is this aspect of including an
alt attribute which is the most important, not simply for satisfying the validator - the attribute is required because of its importance for accessibility.
Of course, ideally such graphics should be always inserted via CSS rather than being inline, but that's not always possible or practical.
Thanks I understand why we need the alt tags now. I'll go with alt="" for things that don't need a description.