Jump to Real's How-to Main page

Display tooltip in HTML

The TITLE attribute in almost every HTML tag is used to display a tooltip.
<html><body>
    <img src="../images/gumby.gif" title="My name is Gumby">
<p>
    <a href="http://www.google.com"
       title="The Google Search Engine">Google</a>
<p>
    <table title="Sales Figures">
    <caption>Jan 2007</caption>
        <tr title="row 1"><td>111111<td>222222
        <tr><td>333333<td title="col 4">444444
    </table>
</body></table> 
<form>
<input type="text" size=25 title="Enter your email address here">
<input type="button" value="Submit" title="Click to submit!">
</form>
<div title="End of this HowTo">End.</div>    

It looks like

Google

Jan 2007
111111222222
333333444444

End.

NOTE : IE can display *multi-line tooltip* but Firefox won't.
<span title="line 1 &#10; line 2">*multi-line tooltip*</span>

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2007
[ home ]