Tooltips with HTML Entities

This trick lets you overcome the text-length limit in ALT tags.

Readers

June 3, 2002

1 Min Read
ITPro Today logo in a gray background | ITPro Today


My company typically uses ALT tags with our images not only to provide an alternative for users who don't want to wait a long time for images to download but also as an elegant way to provide an explanatory tooltip. Unfortunately, the text length in these ALT tags is limiting. We've come up with a small trick to solve this limitation. We use line breaks and indentations to make tooltips more explanatory. But be warned that these tooltips persist for only about 4 seconds.

You can extend the tooltip property to any HTML element that has a TITLE attribute. Listing 1 contains a sample tooltip. Although not all browsers support the tooltip property, it works in Microsoft Internet Explorer (IE) without a glitch.

—Deepak Kumar Vasudevan
[email protected]

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like