Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

alt text for text 1

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
how can I make alt text for text?

[conehead]
 
Do you mean a tooltip?

If so, be wary of using the alt attribute for tooltips in any instance: MS IE is the only browser to show the alt as a tooltip.

The proper attribute for a tooltip is title:
Code:
<span [highlight]title="INTELLIGENT WORK FORUMS FOR COMPUTER PROFESSIONALS"[/highlight]>Tek Tips</span>

This is also appropriate for giving tooltips to images:
Code:
<img src="something.jpg" alt="alternative for text only browsers" title="tooltip" />

If you want an alt tag on an image, but do not feel it needs a tooltip, you can use a null title to suppress the tooltip in IE:
Code:
<img src="something.jpg" alt="alternative for text only browsers" title="" />
As alt is a required attribute of img in XHTML, this is likely to become increasingly common.

<marc>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top