Web Design / HTML

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

Use the Title Attribute as a Tool Tip

Not the Alt Attribute

By Jennifer Kyrnin, About.com

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

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Web Design / HTML

  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

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

All rights reserved.