I keep forgetting and need some clarification on the use of alt and title
and which is most appropriate.
I am using the strict dtd so as far as I understand I'm meant to use alt for links and title for images. Or is it the other way around? Or both?
Fairly simple one. Is this correct?
Hi Brett,
The 'alt' attribute should be used as a text alternative for replaced elements, such as images. This is for user agents which do not display images such as text browsers, browsers with images disabled, speech browsers, screen readers. It should typically provide a very brief description of the image, or - if the image conveys textual information - reiterate what the image text says. If an image is purely for layout or decoration the alt text should be an empty string, ie alt="" (a null string, not a space).
The title attribute provides a description of, or some brief informative text about, an element. It is often used on images and links as many browsers display it as a 'tooltip', but it can be applied to *any* element.
If more information about an image (or any other element) is required then the 'longdesc' attribute can be used, containing the URL of the document containing the information, however browser support is poor.
Chris
****************************************************** The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm for some hints on posting to the list & getting help ******************************************************
