HTML <html> tagS2C Home   « HTML <html> tag

Definition

The <html> tag denotes the start and end of a HTML document and is the document root element of a HTML document.

Example


<html  xmlns="http://www.w3.org/1999/xhtml">
<!-- Everything goes between the start and end HTML tags. --> 

<head>
<!-- The header contains meta information pertaining to the HTML document as well 
as a title and other stuff we will discuss in HTML Intermediate/Advanced lessons.
External files such as CSS stylesheets and JavaScript files are also imported in
the header section of our HTML file. -->
  <title>Appears in browser toolbar, favourites and search engine results.</title>
</head>

<body>
<!-- The content of the web page appears in the body section. -->
</body>

<!-- We complete the HTML file with the closing HTML tag. -->
</html>

Required Attributes

xmlns - this attribute is used to define the XML namespace and is always the value as shown above.


<html  xmlns="http://www.w3.org/1999/xhtml"></html>

Optional Attributes

NONE

Common Attributes

NONE

Language Attributes

dir - specifies the directional flow of the content.


<html dir="ltr"></html>   <!-- The text will flow from left to right -->
<html dir="rtl"></html>   <!-- The text will flow from right to left -->

lang - specifies a language code for the content of the element.


<html lang="en">Some text here</html>

xml:lang - specifies a language code for the content of the element in XHTML documents.


<html xml:lang="fr">Some text here</html>

Event Attributes

NONE

go to home page Homepage go to top of page Top