What is the difference? If I in .NET use Tooltip on an asp:Image element, it renders a title tag.

3 answers

4
points

Titles are there to give a tooltip to the user, plain and simple. The Alt-attribute on the other hand is to give a fallback and textual representation of an image. It's a must have for images that convey meaning or content and should always be used (even on pure aesthetic images alltough empty, like so alt=""). It is also good for search engines as Russel allready pointed out.

The Alt-attribute should be hidden from sighted users but IE up to (but not including from what I've heard) IE8 misinterpret the standards displaying it as a tooltip if a Title-attribute is not present.

The Alt-attribute should be brief and relevant, such as "The luxury boat of Bill Gates and sundown" or "Wall Street building in flames". A Title on the other hand can be used not only for images to give extra information or support to enhance the experience and usability of a given element.

For example a link (anchor-element) in a webshop that says "Next" could have a title-attribute of "To checkout" to indicate what the next step is (alltough you could argue in this case that it would be better to name the link "To checkout", but sometimes that might not be possible). Another example is a image icon that indicates something like "In stock" our "Out of stock", but exactly What it means in the title-attribute to explain it to users unfamiliar with the icon.

Answered over 7 years ago by Jens Hedqvist
danwellman 5600
1
point

alt = alternative text, to be displayed when the image it is an attribute of cannot be displayed

title = tooltip text, to be displayed when the mouse pointer hovers over an element with the title attribute configured. It is not required for validity, but it is required on elements like <abbr>, <accronym>, frames and <a> elements for accessibility reasons.

IE screws up the alt attribute and older versions display alt text as if it were title text

Both attributes have SEO benefit :D

Answered over 7 years ago by danwellman
-3
points

All images should have an alt tag, as this is required for valid xhtml strict. It's there for usability (those who browse without images) and also to tell search engines what that image is of.

Title's I'm not so sure on, you'll have to wait for another answer :)

Answered over 7 years ago by Russell Bishop