Forum Moderators: open

Message Too Old, No Replies

Text ALT tag?

Is it possible?

         

web_young

9:40 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



I know that alt tags for images show the text when someone mouses over the image. What I'm wondering is there a way to do the same thing with a word or block of text. When someone hovers over the text I'd like a little box of text with additional info to show up. Does that make any sense? Is it possible?

aevea

9:57 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



Use the title attribute.

storevalley

10:00 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



You could put the block of text behind a transparent image and use the alt tag of the image.

There are also a few DHTML scripts around that allow you to do this kind of stuff. Search Google for "dhtml tooltip"

DrDoc

10:21 pm on Jan 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



alt tags for images show the text when someone mouses over the image

They are not supposed to.
If you want text to show when you hover any (almost) element -- use the title attribute (as pointed out).

choster

10:28 pm on Jan 9, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In the newer specifications, the title attributes is also supposed to be used for descriptive text, and alt is re-emphasized as "replacement text." There isn't universal consensus on formatting, but I typically view alt as "what is this?" and title as "why should anyone care?"

<img src="map.gif" title="Ourtown is located in north-central Bigcounty along Interstate 13" alt="[Map of Towns in Bigcounty]" />.

DrDoc beats me again! :-)

web_young

11:10 pm on Jan 9, 2004 (gmt 0)

10+ Year Member



Thanks.

TheDoctor

5:55 pm on Jan 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I typically view alt as "what is this?" and title as "why should anyone care?"

Brilliantly put.

bull

10:40 pm on Jan 10, 2004 (gmt 0)

10+ Year Member



you could also use <acronym>

g1smd

9:52 pm on Jan 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If alt text (by the way it is an attribute, not a tag) pops up then that is a browser bug.

Only the contents of the title attribute should pop up.