Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FP2000: How to Use ALT and TITLE Attributes to Display Additional Information on Hyperlinks


View products that this article applies to.

Summary

This article shows you how to use ALT or TITLE HTML attributes to display additional information when the viewer points to images or hyperlinks on your Web pages. Note that the ALT and TITLE attributes are not equivalent, and the TITLE attribute is not recognized by all browsers.

↑ Back to the top


More information

HTML elements can include the attributes ALT or TITLE so that additional information is displayed when the viewer points to an image or hyperlink on the page in the browser. This functionality is most commonly used to supplement an image, but it can also be used to provide additional information about text links in Microsoft Internet Explorer.

The ALT attribute applies only to images and is recognized by all common browsers, whereas the TITLE attribute applies to hyperlinks, whether text or image, as well as to images; however, it may not be recognized by browsers other than Internet Explorer.

Syntax

The following are examples of the syntax for the two attributes:
<img source="file:///C:/Photos/Mom1.jpg" alt="Picture of Mom">
				
-or-
<a href="file:///C:/Photos/Mom2.jpg" title="Photo of Mom">mother</a>
				
Notice that in the first case, the browser displays the image (Mom1.jpg) and displays the text "Picture of Mom" as a ScreenTip when the viewer points to the image; whereas in the second case, the browser displays the text "mother" as a hyperlink and displays the ScreenTip "Photo of Mom" when the viewer points to the hyperlink.

Internet Explorer recognizes the TITLE attribute when it is used in place of the ALT attribute for images, but other browsers (such as Netscape Navigator) may not. As a result, the following image reference
<img source="file:///C:/Photos/Mom1.jpg" title="Picture of Mom">
				
produces a ScreenTip when viewed with Internet Explorer, but may not when viewed with other browsers.

↑ Back to the top


Keywords: KB264916, kbinfo, kbhowto

↑ Back to the top

Article Info
Article ID : 264916
Revision : 2
Created on : 12/2/2000
Published on : 12/2/2000
Exists online : False
Views : 220