html
  1. html-title-tag

HTML <title> Tag

The HTML <title> tag is used to define the title of an HTML document. It is a required element which is placed inside the <head> section of your HTML document and appears on the browser's title bar and in search engine results.

Syntax

<head>
    <title>This is the title of the document</title>
</head>

Example

<!DOCTYPE html>
<html>
    <head>
        <title>My Website Title</title>
    </head>
    <body>
        <h1>Welcome to my website</h1>
        <p>This is my first webpage</p>
    </body>
</html>
Try Playground

Explanation

The HTML <title> tag is a container element that contains the title of the HTML document. The text inside the <title> tag is displayed on the title bar of the browser window, and it helps users and search engines to identify the content of the webpage.

Use

The HTML <title> tag is used to define the title of an HTML document. It is used to:

  • Describe the content of the HTML page to search engines
  • Help users identify the content of the webpage
  • Display the title of the webpage in the browser's title bar
  • Enable bookmarking of the webpage with an appropriate title

Important Points

  • The text inside the <title> tag should be descriptive and relevant to the content of the HTML page.

  • The length of the <title> should not exceed 60 characters or it may get truncated in search engine results.

  • The <title> tag is very important for search engine optimization (SEO) as it tells the search engines what the HTML page is about.

  • You can use variables or data from the HTML page dynamically in the title by using a server-side scripting language like PHP.

Summary

In summary, the HTML <title> tag is an essential element of any HTML document, and it should be used to describe the content of the HTML page to the search engines and users. It is a simple tag to use and has a significant impact on search engine optimization and user experience.

Published on: