HTML title - how to use <title> tag

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

Title is required for all HTML documents. If a proper title can/should not be set, then define but leave the <title> tag empty. A HTML document will validate if the <title> tag is missing.

The text within the <title> tag appears as search engine results and in the top of the browser.

A page can have only one <title> tag.


The title tag supports the global and event attributes.


<head> <title>Title of the page</title> <style> p { color:red;} </style> </head> <!--empty title--> <head> <title></title> <style> p { color:red;} </style> </head>

Related HTML tags:

  • <head> - used to define the head section of a page