Thursday, January 6, 2011

The html Element

The html element is topmost in the hierarchy of (X)HTML elements and is known as the root element. Therefore all (X)HTML elements are descendants of the html element. The html element appears after the Document Type Declaration.

The head and the body elements, and, in the case of a Frameset document, the frameset element are the only child elements of html.

Example: <html lang="en">

Attributes

lang and xml:lang
These attributes specifiy the language of the contents of the document. See this page for more information.
dir
See this page.
id
This attribute is used to uniquely name the html element. It is allowed on the html element only when the doctype is XHTML.
version
This is a deprecated attribute. Its value is the Formal Public Identifier of the HTML Document Type Definition (DTD) of the document. This attribute should not be used because the DTD of the document is specified in the doctype.
xmlns
This is a required attribute in XHTML documents. It specifies the XML namespace of the document.

No comments: