w3resource

HTML html tag and element

Description

1. HTML html element represents the root element of an HTML or XHTML document.

2. All other elements are placed between start and end tags of HTML.

Syntax:

<html>other elements </html> 

Category:

HTML html element is part of the global structure of an HTML page.

Whether both start and end tags are required

Both start and end tags are optional.

Can contain:

HTML html element can contain inline as well as block level elements.

Can reside within

Since HTML html element is the root of an HTML document, it can not reside within any inline as well as block level element.

Attributes:

Attributes specific to this element

version - this attribute specifies which version of the HTML is followed in that document. But this attribute is deprecated against Doctype Declaration, which contains the version information of an HTML document.

Identifiers:

Does not support.

language information and text direction

lang, dir.

Title:

Does not support.

Style:

Does not support.

Events:

HTML html element does not support event attributes.

Example of using HTML html element

Bellow is a simple HTML page.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>html html tag example</title>
</head>
<body>
<p>We are learning HTML html element. </p>
</body>
</html>

Result:

html html element

View this example in a separate browser window:

HTML html tag example.

Pictorial presentation

HTML html tag

Previous: DOCTYPE HTML 4.01 tutorial
Next: HTML head tag and element