tadam logo

HTML <title> Tag

Example

A simple HTML document, with the minimum of required tags:
<html>
<head>
<title>My first HTML page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>

<body>
<p>The content of the body element is displayed in the browser.</p>
<p>The content of the title element is displayed in the browser's title.</p>
</body>

</html>
The output of the code above will be:

Definition and Usage

The <title> tag defines the title of the document.

The title element is required in all HTML/XHTML documents.

The title element:

  • defines a title in the browser toolbar
  • provides a title for the page when it is added to favorites
  • displays a title for the page in search-engine results

Browser Support

The <title> tag is supported in all major browsers

Differences Between HTML and XHTML

NONE

Standard Attributes

The <title> tag supports the following standard attributes:
AttributeValueDescriptionDTD
dirrtl
ltr
Specifies the text direction for the content in an elementSTF
langlanguage_codeSpecifies a language code for the content in an elementSTF
xml:langlanguage_codeSpecifies a language code for the content in an element, in XHTML documentsSTF
More information about Standard Attributes.
DTD indicates in which HTML 4.01/XHTML 1.0 DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.

Event Attributes

The <title> tag does not support any event attributes.

More information about Event Attributes.

Was this information helpful?
   

Comments