Copyright © tutorialspoint.com

HTML <html> tag



Advertisements

Function:

The HTML <html> tag is the container that contains all other HTML elements except for the !doctype tag which is located before the opening <html> tag. All other HTML elements are nested between the <html> and </html> tags.

Difference between HTML and XHTML:

The xmlns attribute is required in XHTML but not in HTML.

Example:

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

<head>
</head>

<body>
<p>Actual content goes here </p>
</body>

</html>

Online Practice:

To Become more comfortable - Do Online Practice

Attributes:

AttributeValueDescription
xmlnsURLDefines the XML namespace attribute. For example http://www.w3.org/1999/xhtml

Standard Attributes:

AttributeDescription
dirSpecifies the direction of the text
langSets the language code.

Copyright © tutorialspoint.com