March 7, 2000 - Creating Tooltips | WebReference

March 7, 2000 - Creating Tooltips

Yehuda Shiran March 7, 2000
Creating Tooltips
Tips: March 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

A tooltip element is nothing more than a plain HTML DIV element. By utilizing the CLASS attribute, we can assign the same set of style definitions to each tooltip. The basic syntax of our tooltip is as follows:

<STYLE TYPE="text/css">
#id {
  width: width;
}
</STYLE>
<DIV CLASS="tooltip" ID="id">code</DIV>

where id is the value of the DIV element's ID attribute, width is the width of the tooltip box, and code is the text to be displayed in the tooltip box. Note that the specified text may also include other HTML definitions, such as images, tables, and styling tags. The tooltip class designates a general stylesheet for the tooltips on the page. It defines the background color, padding, border color, and other common attributes for the tooltips.

Learn more about tooltip construction in Column 16, Dynamic Tooltips.