Click here to get back home

alt vs title for img tags

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
alt vs title for img tags David Stone 08-18-2006
Posted by David Stone on August 18, 2006, 2:46 pm
Please log in for more thread options


At first glance, alt and title seem to be a bit of a duplication
for img tags in html.

Are there any _practical_ differences for the html 4 strict doctype?

What would be the consequences (if any) of using title instead of alt?

Posted by Dan on August 18, 2006, 3:13 pm
Please log in for more thread options



David Stone wrote:
> At first glance, alt and title seem to be a bit of a duplication
> for img tags in html.
>
> Are there any _practical_ differences for the html 4 strict doctype?
>
> What would be the consequences (if any) of using title instead of alt?

They have different purposes. ALT, which is required, is used for
replacement content in cases where the image is not displayed (such as
text-mode browsers, audio readers, images unable to load, etc.).
TITLE, which is optional, is used for supplementary information, such
as to display as a tooltip.

--
Dan


Posted by Els on August 18, 2006, 3:15 pm
Please log in for more thread options


David Stone wrote:

> At first glance, alt and title seem to be a bit of a duplication
> for img tags in html.
>
> Are there any _practical_ differences for the html 4 strict doctype?
>
> What would be the consequences (if any) of using title instead of alt?

They are two entirely different things, regardless of which type of
html you use.
Title gives you a tooltip when hovering over the image, while alt
gives you an alternative text if the image doesn't load for whatever
reason. IE uses the alt for the tooltip if the title is absent, but
other browsers don't do that.

--
Els http://locusmeus.com/
accessible web design: http://locusoptimus.com/

Now playing: De Dijk - Man op de radio

Posted by Harlan Messinger on August 18, 2006, 3:37 pm
Please log in for more thread options


Els wrote:
> David Stone wrote:
>
>> At first glance, alt and title seem to be a bit of a duplication
>> for img tags in html.
>>
>> Are there any _practical_ differences for the html 4 strict
>> doctype?
>>
>> What would be the consequences (if any) of using title instead of
>> alt?
>
> They are two entirely different things, regardless of which type of
> html you use. Title gives you a tooltip when hovering over the image,
> while alt gives you an alternative text if the image doesn't load for
> whatever reason. IE uses the alt for the tooltip if the title is
> absent, but other browsers don't do that.

And, by the way to the OP, title doesn't have anything particularly to
do with images. All content tags in the body can have a title.

Posted by David Dorward on August 18, 2006, 3:20 pm
Please log in for more thread options


David Stone wrote:

> At first glance, alt and title seem to be a bit of a duplication
> for img tags in html.

Title provides advisory information about the image, alt provides a text
replacement for the image (in the event that the image cannot be
displayed).

> What would be the consequences (if any) of using title instead of alt?

The document would be invalid. Search engine indexers, people with images
turned off, people using text browsers, people using aural browsers, people
using braille output devices, and probably a bunch of other people wouldn't
get the content at all.

http://htmlhelp.com/feature/art3.htm is probably a worthwhile read for you.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is

Similar ThreadsPosted
Style tags -- Eeek how obese these tags make HTML! November 8, 2006, 3:33 am
Meta Tags, Link Tags, other September 27, 2005, 3:29 pm
What is the different between "title" and "alt" for html tag "img"? October 29, 2004, 12:39 pm
Image in the title January 7, 2005, 4:09 pm
"Relocate" in Title tag May 9, 2005, 6:40 am
The title attribute December 18, 2007, 5:45 pm
img title core attribute January 13, 2005, 12:54 pm
Errors from title tage February 15, 2005, 4:16 am
Length of title attribute May 27, 2005, 5:02 pm
Entities in alt and title text July 31, 2007, 4:07 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap