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 html tag

Bypass main content

HTML html tag

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

Bypass main content

Description

The HTML html element acts as container for the entire document. The only thing left out of this element is the HTML !DOCTYPE tag, which is declared in the first line of the document and defines its type.

The "version" attribute for this element has been deprecated in HTML 4.01 in favor of the HTML !DOCTYPE tag.

Examples

The following code shows a simple example document.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
...Content of the head...
</head>
<body>
...Content of the body...
</body>
</html>

Attributes

lang (langcode)

Specifies the language of an element's content. The default value is "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 as 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:

<q lang="he" dir="rtl">...an Hebrew quotation...</q>

version (cdata)

Declares the version of the HTML document. This attribute has been deprecated in HTML 4.01 because of the redundancy produced with the HTML !DOCTYPE tag.

Events

This element doesn't support any event.

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