[whatwg] Please consider simplifying authoring guidance for the <img> alt attribute

Markus Ernst derernst at gmx.ch
Mon Aug 2 08:19:10 PDT 2010


Am 01.08.2010 11:43 schrieb Tantek Çelik:
> http://wiki.whatwg.org/wiki/Img_Alt
> 
> I encourage fellow web authors to add opinions/comments.

My personal opinion on the alt attribute is that:
- it should only be used if the image is crucial for understanding the 
content, or for navigation (such as headline or link images or charts)
- it's absence should default to what is alt="" in HTML4
- search engines should generally ignore text in the alt attribute, but 
evaluate the title attribute instead

Rationale:

4.8.1.1.12 says: "A corollary to this is that the alt attribute's value 
should never contain text that could be considered the image's caption, 
title, or legend. It is supposed to contain replacement text that could 
be used by users instead of the image; it is not meant to supplement the 
image. The title attribute can be used for supplemental information."

The most common use cases of @alt are (at least as far as I know from my 
authoring practise):
- Insert the text contained in a headline or link image
- Insert an empty string to make the page validate
- Insert a short description of the image, preferably containing some 
keywords for search engines; sometimes the search engine aspect is 
weighted even higher than the contents of the image here

Only the first one of these use cases matches the gideline given in 
4.8.1.1.12. The second one is not harmful, exept some minimal bandwidth 
impact. But the third one is actually counterproductive with regard to 
accessibility.

An image which conveys information, if it is not a text replacement 
(such as a headline or link image), a corporate logo, or some kind of 
chart, is usually almost impossible to describe in a way that can't be 
considered the image's caption, title, or legend. Usually, the 
information conveyed by the image is either duplicated in the text that 
the image is associated to (or in it's caption or legend), or at all 
useless for anybody that does not see the image. Either way, the 
presence of an alt text does not provide useful information, but 
possibly confuses - specially if it is written with regard to search 
engines.

I am confident that declaring the alt attribute as optional would not 
only simplify the spec and validation, but also have no significant 
effect regarding accessibility, as poor authoring cannot really be 
prevented by structural means.

And I am also confident that if search engines ignored the alt 
attribute, and authors were encouraged to only insert alt text if helps 
to understand the content, this would have a positive effect on 
accessibility, as authors would be discouraged to put unnecessary 
information in the alt attribute for seo purposes, or duplicate the 
legend or caption (what I used to do before I read 4.8.1.1.12, because 
HTML4 seemed to require exactly this).



More information about the whatwg mailing list