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


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


<html  xmlns="">
<!-- Everything goes between the start and end HTML tags. --> 

<!-- 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>

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

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

Required Attributes

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

<html  xmlns=""></html>

Optional Attributes


Common Attributes


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


go to home page Homepage go to top of page Top