Webpage Workshop: Home » XHTML 1.0 language reference » HTML document

HTML document

This element is the top-level container in an HTML document. It is used to declare that the document is HTML and that it will contain HTML elements. It seems strange that XHTML should begin with such a declaration, yet an XHTML equivalent is not part of the specification.

    dir="ltr | rtl"
    lang="language code"

‡ = Required attribute
** = Transitional only

Explanation of attributes

dir: used to set the direction of the text in combination with the language set in the lang attribute. The available values are "ltr" (left to right) and "rtl" (right to left), with the default value being "ltr".

lang: used to indicate the language being used in the text contained within the element. The value of this attribute takes on the form of the ISO standard lanuage abbreviations found in RFC 3066. A list of these codes can be found on the ISO language codes page.

version**: this attribute is used to indicate the location of the DTD for the version of HTML being used. This has been deprected as the HTML version is specified in the doctype at the start of the document. In practice, this attribute is neither used nor supported.

xmlns: this attribute is used to declare the XML namespace for the document. The standard value for this attribute is http://www.w3.org/1999/xhtml, which points to the XHTML specification.

Event handlers

No event handlers are defined for this element.


Description: Support of HTML document and attributes in various browsers
Test Internet Explorer 6+ Netscape 4 Mozilla and Netscape 6+ Opera 6+ MSN TV (WebTV) Konqeuror 3.0+
Basic element support  Yes  Yes  Yes  Yes  Yes  Yes 
Attribute: dir  Yes  No  Yes  Yes  No 
Attribute: lang  No  Yes  No 
Attribute: version  No  No  No  No  No  No 
Attribute: xmlns  Yes  No  No  No  No  No 

The browser icons are explained in the below list:
Internet Explorer 6+ = Microsoft Internet Explorer 6+
Netscape 4 = Netscape Communicator 4
Mozilla and Netscape 6+ = Mozilla and Netscape Navigator 6+
Opera 7+ = Opera 7+
MSN TV (WebTV) = MSN TV (aka. WebTV)
Konqeuror 3.0+ = Konqueror 3.0+