HTML title Attribute Tutorial

In this section, we will learn what the title attribute is and how to use it in HTML.

What is title Attribute in HTML? (HTML Tooltip)

The title attribute as the name suggest, is used to set a title for an HTML element.

The value we set for this attribute then will appear in a tooltip over or under the target element when the mouse cursor is over the box of that element.

HTML title Attribute Syntax

<element title = “value”>

HTML title Attribute Values

The value we set for the title attribute is a text content that we want to appear in a tooltip on the target element when a mouse is over it.

Example: HTML tooltip hover

<!DOCTYPE html>
<html>
<head>
<title>HTML is fun 🙂 </title>
</head>
<body >
<p title="This is a Paragraph"> Bring the mouse cursor over me! </p>
</body>
</html>