Categories
Web development

HTML title Attribute

Learn how to use the HTML title Attribute.



HTML title Attribute

The HTML title attribute defines extra information about an element (can be used on all HTML elements).

The information is often displayed as a tooltip text when the cursor hovers over the element.

Syntax:

<element title="text"> 

text – a tooltip text for an element.

Example:

<!DOCTYPE html>
<html>
<body>

<p title="Leran HTML, CSS and JavaScript">www.lenadesign.org</p>

</body>
</html>

Output:

Hover over the text:


lenadesign.org


Enjoy coding!

Read also:

HTML class Attribute

HTML data-* Attribute

CSS Tooltips