Skip to content
Related Articles

Related Articles

Improve Article

HTML | title Attribute

  • Last Updated : 10 Aug, 2021

The title attribute is used to specify extra information about the element. When the mouse moves over the element then it shows the information. 
Supported Tags: It supports all HTML elements. 

Syntax: 
 

<element title = "text">

Attribute Value: This attribute contains single value text which is used as the tooltip text for an element. This title is associated with all HTML elements. 
Example: 
 

html




<!DOCTYPE html>
<html>
 
<head>
    <title>title attribute</title>
    <style>
        body {
            text-align: center;
        }
         
        h1 {
            color: green;
        }
    </style>
</head>
 
<body>
    <h1>GeeksforGeeks</h1>
    <h2>title attribute</h2>
 
    <p title="GeeksforGeeks: A computer science
        portal for geeks">
      GeeksforGeeks.org
    </p>
 
</body>
 
</html>

Output: 
Before hovering the mouse: 
 



After hovering the mouse: 
 

Supported Browsers: The browser supported by title attribute are listed below: 
 

  • Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

 

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

My Personal Notes arrow_drop_up
Recommended Articles
Page :