View Full Version : <alt> vs <title>
tomyknoker
04-22-2007, 07:03 AM
i've noticed that when i use the <alt> tag and rollover an image the alternative text doesn't show up, it only show's up when i use the <title> tage... do i need to be using both?
jscheuer1
04-22-2007, 07:35 AM
According to the standard, alt is required. It may be empty though:
alt=""
Except for IE, no browser uses alt as a rollover tip. If there is a title specified, IE will use the title. If there is an alt and an empty title, IE will show no rollover tip.
IE is the exception but, as long as you follow the standard, you will be OK:
Provide alternate content (text) for images using the alt attribute. This will only be used if the image is missing or someone is using a browser for the blind or a text only browser - except in IE where it will be a tip if no title (even an empty one) is specified. Use an empty alt attribute if the image is purely decorative.
Provide rollover tips, if desired, with the title attribute.
tomyknoker
04-22-2007, 07:37 AM
So should I porvide both or is that overkill?
jscheuer1
04-22-2007, 07:48 AM
The alt attribute is required. The title attribute is optional. I already explained how these two work. It is up to you (what effects you want) how you use them. Just make sure to at least have an empty alt attribute.
djr33
04-22-2007, 07:57 AM
In short:
1. alt gives you validation
2. title gives you a rollover message
(3. alt gives you a rollover message in IE only, only if title is missing)
tech_support
04-22-2007, 08:47 AM
4. alt is designed for people with disabilities, so they can have a brief description of the image.
djr33
04-22-2007, 09:15 AM
Sorta. It's the alternate to the image, to describe it if needed.... for those without vision, for when the image doesn't load, is corrupt, and other situations.
I believe, though, that title also would suffice for some of this, in that a screenreader for the blind would likely find that important, especially if alt was blank or missing.
tech_support
04-22-2007, 09:18 AM
Random Google Result:
In HTML authoring, there are very good reasons to include an alt attribute into every img element. The purpose is to specify a textual replacement for the image, to be displayed or otherwise used in place of the image. Thus, the prime rule is: Consider what the page looks like or sounds like when images are not shown. Then, write for each image an alt text that best works as a replacement. This document also gives more specific suggestions for simple, common situations, and some uncommon too. For content-rich images, it recommends explicit links to textual alternatives.
tomyknoker
04-22-2007, 09:22 AM
So then should you use both <alt> and <title>??
tech_support
04-22-2007, 09:24 AM
Well, it is up to you.
Another Google Result:
The title attribute is intended to provide supplementary information about an element; for example, it might be used to provide extra information about the target of a link. Although the User Agent Accessibility Guidelines (UAAG) requires access to all content, current user agents provide very poor access to title text information, and what access they do provide is typically inaccessible for people with disabilities.
It's really very simple: title is intended to be shown with the image, while alt is intended to be shown instead of the image where necessary. alt must always be provided, although for purely decorative images that convey no meaning it can be blank. The title attribute is completely optional.
mwinter
04-22-2007, 11:15 AM
So then should you use both <alt> and <title>??
You should always the alt attribute. That is never in question. The value may be empty (alt="") or containing only white space (alt=" ") in the case of decorative images, but it should always be there.
The title attribute should provide additional, but unnecessary information: the information is important, it should be included in the surrounding prose.
The two attributes have different purposes, so the values should not normally be the same.
Mike
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.