Basic Structure

HTML <title> Tag

The <title> tag defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab.

Definition and Usage

The <title> tag defines the title of the document. The title must be text-only, and it is shown in the browser's title bar or in the page's tab.

Standard Syntax:<title>...</title>

Interactive ExampleRunnable

HTML <title> Example

html
Try it Yourself
Live code demonstration for the <title> tag. Click "Try it Yourself" to edit and experiment in real time.
<!DOCTYPE html>
<html>
<head>

  
 <title>HTML Elements Reference</title>

 </head>
<body>

    
<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

Attributes for <title>

0 Supported Attributes

The <title> tag does not have tag-specific attributes. It supports all standard Global Attributes.

Global Attributes

The <title> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <title> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Basic Structure

View All 123Tags →