HTML Tags

HTML <title> Tag

Topic: HTML5 Tags ReferencePrev|Next

Description

The <title> tag defines the title of the document. The <title> element should be the first element defined in the head section of the document. The title should be meaningful because it summarizes the content or purpose of the document.

The <title> element is very important, because its content is used by the:

Web browsers

  • To display the page title in the web browser's title (top of a browser) and tab(s).
  • To label the web page when it is bookmarked or added as a favorite.

Search engines

  • To display a clickable headline for the web page when it listed on the Search Engine Result Pages (SERPs).
  • To determine the topic of the web page. Search Engine spiders or crawlers analyze the content of the page title and then decide the page topic.

The following table summarizes the usages context and the version history of this tag.

Parent: <head>
Content: Text
Start/End Tag: Start tag: required, End tag: required
Version: HTML 2, 3.2, 4, 4.01, 5

Note: Every HTML document must contain one and exactly one <title> element in the head section. The title should ideally be 65 characters in length.


Syntax

The basic syntax of the <title> tag is given with:

HTML / XHTML: <title> ... </title>

The example below shows the <title> tag in action.

<!DOCTYPE html>
<html>
<head>
    <title>A simple HTML document</title>
</head>
<body>
    <p>Hello World!</p>
</body>
</html>

Tag-Specific Attributes

The <title> tag doesn't have any specific attribute.


Global Attributes

Like all other HTML tags, the <title> tag supports the global attributes in HTML5.


Event Attributes

The <title> tag also supports the event attributes in HTML5.


Browser Compatibility

The <title> tag is supported in all major modern browsers.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 2.1+

Further Reading

See tutorial on: HTML Head.

Related tags: <html>, <head>.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties