XML technologies / CSS / CSS Cookbook / Links and navigation / Tooltips

(Excerpt from “CSS Kochbuch” by Christopher Schmitt)

Problem

You want a tooltip to appear when the mouse pointer is over a link (see the next figure).

The title attribute’s value is displayed as a tooltip

Figure: The value of the title attribute is displayed as a tooltip.

Solution

In the a tag, use the attribute title to create the tooltip:

<a href="http://www.google.com/" title="Web durchsuchen">...</a>

Discussion

Tooltips can be defined for almost any web page element, for example to improve accessibility or explain its content. Try this technique on table cells, form input fields and links.

See also

The HTML 4.1 specification for the attribute title.

  

 

 

 

back to top