HTML XHTML The Complete Reference
home » reference » appendix a » html element reference

<html> (HTML Document)


This element identifies an HTML or XHTML document.

Standard Syntax


<html
dir="ltr | rtl"
id="unique alphanumeric identifier"
lang="language code"
xmlns="http://www.w3.org/1999/xhtml
</html>

Attributes Defined by Internet Explorer


class="class name(s)" (4)
scroll="yes | no | auto" (6)

Events Defined by Internet Explorer


onlayoutcomplete, onmouseenter, onmouseleave, onreadystatechange

Element Specific Attributes


scroll
This attribute is used to set whether scroll bars should show for the document or not. The default value of auto puts in scroll bars as needed. This attribute, while documented by Microsoft, does not appear to work properly and should be avoided.

xmlns
This attribute declares a namespace for XML-based custom tags in the document.

Example


<!-- Minimal HTML document -->
<html>
<head>
  <title>
Minimal Document</title>
</head>
<body></body>
</html>

Compatibility


HTML 2, 3.2, 4, 4.01, XHTML 1.0, 1.1, Basic
Internet Explorer 2, 3, 4, 5, 5.5, 6
Netscape 1, 1.1, 2, 3, 4, 4.5-4.8, 6, 7
Opera 4-7

Notes


The html element is the first element in a document. Except for comments, the only tags it directly contains are <head> followed by either <body> or <frameset>.

Because it is the outermost tag in a document, the html element is called the root element.

Under the XHTML 1.0 specification, <html> can no longer be implied.

The <html> tag and its closing tag </html> are both mandatory under XHTML.

Under HTML 4 transitional, a version attribute is supported.

(X)HTML Elements
CSS Properties
Previous: hr Next: i
< Home | About | Chapters | Examples | Errata | Reference | Site Map >