On 3/18/06, <b class="gmail_sendername">Patrick R. Michaud</b> <<a href="mailto:pmichaud@pobox.com">pmichaud@pobox.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
... is it important to make a distinction between alt= and title= in images?</blockquote><div><br>The HTML spec says alt= is mandatory and should be used in place of the image when the image cannot be displayed or the user has chosen not to display images.
<br></div><br></div>The title= attribute is optional and should be used to describe "advisory information about the element for which it
is set"<br><br>If I was to get pedantic about this I would say they should be used like this:<br><br><img src="pmwikilogo.gif" alt="PmWiki logo" title="This site is powered by PmWiki"/>
<br><br>The alt value should describe the image and the title attribute should describe the reason why the image is there. The obvious one to use for a tooltip is the title attribute and this is consistent with other elements.
<br><br>However, the alt attribute is *mandatory* and some browsers render as a tooltip anyway.<br><br>I just did a test of an image with both attributes. With image unavailable, both Firefox 1.5 and IE6 show an image placeholder with 'broken image' icon and the alternate text within the frame. There is a tooltip with the title text. With the image available, both display the image and use the title text for the tooltip.
<br><br>Remove the optional title attribute and the behaviours differ. Firefox does not have a tooltip, IE6 uses the alt text for a tooltip. This suggests that if the intent is a tooltip, then the title attribute should be used.
<br><br>So the only remaining question is do we need to offer both alt and title as distinct values? From a purist's point of view, yes. Pragmatically? Don't know.<br clear="all"><br>-- <br>Allister