HTML » HTML Core Attributes » title

Version: 4.0

Syntax:
title="string"

The title core attribute is used to assign a name to a tag. This name can be any string of characters or words. Further, you can use the HTML character entities in the name. For example, you could use 

 which will cause a line break (just like the br tag) in the name.

If you wish, you can reuse the same title values repeatedly inside an HTML document, or you could have each value be unique. In contrast, the id attribute requires that each id value must be unique.
 
Do not confuse this attribute with the title tag which is used to assign a title to a web document.
 
The title attribute is used by ToolTips on Internet Explorer to create a small window that automatically displays the text in the title when you run the mouse over a hyperlink or a mapped hyperlink image. This can be done with both the a and area tags. By default, this window is only displayed for about ten seconds. (This concept can also be applied to Netscape by using JavaScript functions. Please read the KB article for details.)
 

Examples

Code:
Please refer to the DevGuru Knowledge Base article:
<br>
<A href="/features/kb/kb100216.html" title="ToolTips are &#10;&#13;really neat!">
A100216: Adding ToolTips to your HTML pages.
</a>
Output:
Please refer to the DevGuru Knowledge Base article:
A100216: Adding ToolTips to your HTML pages.
Language(s): HTML
Code:
<table title="PhoneNumbers">
... table entries
</table title="PhoneNumbers">
Explanation:

As another example, consider the situation where you have a large number of tables on your web page. By placing a title in both the opening and closing table tags, it becomes much easier to identify and keep track of the start and stop of individual tables inside your code.

Language(s): HTML

See Also: