w3resource

HTML title tag and element

1. HTML title element sets a title for an HTML document.

2. An appropriate title helps users as well as search engines to understand the purpose of the page.

3. Text enclosed by the title tags are displayed on the upper right corner of the browser window, when the page is opened.

Syntax

<title>Title of the page</title>
 

Category

HTML title element is part of the global structure of an HTML page.

Whether both start and end tags are required

Both start and end tags are required.

Can contain

HTML title element can not contain any other element.

Can reside within

HTML title element can reside within head element only.

Attributes

Attributes specific to this element

None.

Identifiers

Does not support.

language information and text direction

lang, dir.

Title

Does not support.

Style

Does not support.

Events

HTML html element does not support event attributes.

Example of using HTML title element

Bellow is a simple HTML page which is containing a title.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head profile="https://www.w3resource.com/profiles.html" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>html title tag example</title>
</head>
<body>
<p>We are learning HTML title element. </p>
</body>
</html>

Result

html title tag element

View this example in a separate browser window

HTML title tag example.

Pictorial presentation

HTML-title-tag

Previous: HTML head tag and element
Next: HTML meta tag and element

Test your Programming skills with w3resource's quiz.



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/html/title/HTML-title-tag-and-element.php