PDA

View Full Version : longdesc parameter in img html tag



thosecars82
02 Jan 2010, 09:09 AM
Hello there
I would like to ask you for advice as for using the longdesc tag in html img tag.It turns out that this tool http://wave.webaim.org is saying that the longdesc attributes for the img tags of my site do not contain an url. I do not understand that because they do conatin urls. However, after that I have seen some places like http://en.wikipedia.org/wiki/Longdesc_attribute where it is not very clear whether it is good to use it or not. So, now I am wondering how to fix the problem in case the tool http://wave.webaim.org is right or otherwise whether I should remove this longdesc parameters from the img tags.
Thanks in advance

erilidon
02 Jan 2010, 01:09 PM
Well I've never used nor heard of longdesc but W3C says this:

longdesc = uri [CT]
This attribute specifies a link to a long description of the image. This description should supplement the short description provided using the alt attribute. When the image has an associated image map, this attribute should provide information about the image map's contents. This is particularly important for server-side image maps. Since an IMG element may be within the content of an A element, the user agent's mechanism in the user interface for accessing the "longdesc" resource of the former must be different than the mechanism for accessing the href resource of the latter.


It appears that it is also just used when creating websites for the blind to describe beyond what could be said in the alt attribute. Also the longdesc will be phased out in html5. It is still used in html4 and xhtml1

IMHO, I would just use the alt attribute. I have made a website for the blind before and their software pics up the description in the alt attribute. You can use up to 125 characters in the alt attribute.

As for the error it is giving you I would have to see some code.