1. Home
  2. Computing & Technology
  3. Web Design / HTML

Use the Title Attribute as a Tool Tip
Not the Alt Attribute

By , About.com Guide

One feature of the Internet Explorer browser that many people miss when they start using Firefox is tool tips. Internet Explorer tends to display the alt text when hovering over images as a tool tip. But it's easy to get other browsers to display these types of tool tips as well, just use the title attribute on your images.

<img src="image.gif" alt="Shasta, my dog" title="Shasta, my dog" style="width: 100px; height: 100px;" />

The advantage of using the title attribute is that you can use it on more than just images. If you want a tool tip to show up when someone hovers over a link or even just a block of text, you can use the title to display that. However, tool tips are not widely supported on any element except images and links.

<a href="index.html" title="Go to my homepage">My Homepage</a>
Explore Web Design / HTML
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. HTML and XHTML
  5. XHTML
  6. HTML Tags
  7. Use the Title Attribute as a Tool Tip - Not the Alt Attribute>

©2010 About.com, a part of The New York Times Company.

All rights reserved.