The html Element in XHTML:-
Each XHTML document must be defined as such. After your DOCTYPE declaration, the second line of each document will be your root element, the outermost container-type element, which in this case is the html element. The html element has several new components in XHTML: the namespace and the language identifiers.
The namespace is a unique representation of something that's actually an abstraction. It's both a very simple concept and an incredibly complicated and controversial one. For now, what you need to know is that a namespace is an abstract collection of names, which for purposes here are the elements defined in XHTML. Namespaces, though an abstract collection, need a unique identifier. The best unique identifier the W3C could agree on was a URI, or Uniform Resource Identifier (what most people refer to as a URL).
The namespace is included in the html element as the value of the xmlns attribute:
\<html xmlns="http://www.w3.org/1999/xhtml">
Finally, two attributes for language identification need to appear in the html element. An XML document would require just a single attribute, xml:lang. With XHTML still bridging HTML and XML, an attribute that today's HTML-based browsers will understand is also needed, and that's the lang attribute. The value of these attributes is a two-letter code identifying the language in which the document was written. For purposes here, that will always be "en" for U.S. English. Put all together, the html element now looks like this:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Here, we've gotten the document started with the opening half of the html. At the very end of each XHTML document, the element is closed with the </html> tag.


LinkBack URL
About LinkBacks
Reply With Quote

LinkBacks Enabled by vBSEO
Bookmarks