Forum Moderators: open

Message Too Old, No Replies

"Alt" tag on text?

Trying to add more info to abbreviations

         

woop01

1:31 am on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I want to add a little window similar to the message that shows up when you mouse over an image to some abbreviations we have. How can a person create a similar effect to the alt tag on images to text?

Thanks,

encyclo

1:44 am on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The basic way is to add a
title
attribute to an appropriate inline element surrounding the text in question. For example, an acronym can be denoted by (guess what!) the
acronym
element:

<p>This page is built with <acronym title="Hypertext Markup Language">HTML</acronym> 4.01.</p>

You can also simply use a

span
for more general situations. As for browsers, by default Mozilla/Firefox and Opera distinguish
acronym
with a dotted underline and a cursor change to a question mark. For IE, no visible style is added, so it is best to make an explicit rule in your CSS:

acronym {
border-bottom:1px dotted #333;
cursor:help;
}

woop01

2:18 am on Dec 1, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My gosh, I feel like an idiot now. There's already an element for this? This is what happens when engineers luck into a web design business.

Thanks for the help.