Go to main content
Bypass navigation bar HTML Reference HTML Tags HTML Tutorials
Bypass language selection
Bypass location bar

Location: Home > HTML Reference > HTML Tags > HTML title tag

Bypass main content

HTML title tag

Note: If you don't know what an element/tag is and/or how you must use it we recommend you to read our HTML tags and attributes tutorial that you can find in our HTML tutorials section.

Bypass main content

Description

The HTML title element provides a title for the entire document.

The presence of this element in the head section of the document (HTML head element) is mandatory and its properness crucial. Every well designed page must have a title that correctly describes the content of the document in just a few words.

Authors should consider that pages are usually viewed out of context (i.e., fetched as result of a search engine query) for which the titile should be descriptive by itself. For example, in a website about the problematic of drugs, an article with the title "The impact of drugs in modern society" is fully descriptive, while "Modern society" is not (is only descriptive in the context o the website).

Examples

<head>
<title>The impact of drugs in modern society</title>
</head>
<body>
...A lot of writing about drugs and modern society...
</body>

Attributes

lang (langcode)

Specifies the language of an element's content. The default value in "unknown".

When writing XHTML 1.0 documents, the attribute used to specify the language of an elements is "xml:lang". For forward and backward compatibility both attributes can be used simultaneously like in the example below. Note, that in XHTML 1.1 the "lang" attribute has been completely replaced by "xml:lang" and its use is no longer valid.

<p lang="en" xml:lang="en">This is a paragraph in english.</p>
<p lang="es" xml:lang="es">Este es un párrafo en español.</p>

dir

This attribute indicates the direction in which the texts of the element must be read. This includes content, attribute values and tables. It has two possible values that are case-insensitive:

  • RTL: Right to left.
  • LTR: Left to right.
<q lang="he" dir="rtl">...an Hebrew quotation...</q>

Events

This element doesn't support events.

See a complete list and information about events in HTML

Diseño y desarrollo: Latitud29.com

Links and logos|Contact|Beyond HTML|Tools and resources|Sitemap|Webmaster|Donate