Description

The <html> element defines the root of HTML and XHTML documents. It is the outer container for everything that appears in an HTML (or XHTML) document except <!DOCTYPE>.

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

Parent:None
Content:<head> and <body>
Start/ End Tag:Start tag: optional, End tag: optional
Version:HTML 2, 3.2, 4, 4.01, 5

Syntax

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

HTML/XHTML: <html> ... </html>

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

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

Do not use these attributes! As it has been deprecated in HTML 4.01 and obsolete since HTML5. Use CSS instead.

Tag-Specific Attributes

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

Global Attributes

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

Event Attributes

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

Browser Compatibility

Element
<html>YesYesYesYesYes