Skip to content
Related Articles

Related Articles

Improve Article

How to define a title for a document using HTML5 ?

  • Last Updated : 02 Jun, 2020

In this article, we will define a title for the document by using the <title> tag. This tag in HTML is used to define the title of the HTML document. It sets the title in the browser toolbar. It provides the title for the web page when it is added to favorites. It displays the title for the page in search engine results.

Syntax:

<title> Title name </title>

Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>
        Define a title 
        for the document
    </title>
  
    <style>
        body {
            text-align: center;
        }
  
        h1 {
            color: green;
        }
    </style>
</head>
  
<body>
    <h1>GeeksforGeeks</h1>
  
    <h2>
        HTML5: How to define a
        title for the document?
    </h2>
  
    <p title="GeeksForGeeks">
        Welcome to GeeksforGeeks!
    </p>
</body>
  
</html>

Output:

Supported Browsers:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

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

My Personal Notes arrow_drop_up
Recommended Articles
Page :