<html> tag
The <html> tag is the root(foundation) element in the html page.
Except the <!DOCTYPE> tag, all the other tags must be placed inside the <html> tag.
The <!DOCTYPE> tag is the first statement in the html document and must come before the <!html> tag.
Syntax:
<!DOCTYPE html>
<html>
….
</html>;
Example
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>Welcome to TutorialBrain</h1> <p>Welcome to HTML Tutorial.</p> </body> </html>
Default CSS Values
display: block;
On Focus:
outline: none;
Difference between HTML4.01, XHTML and HTML5
HTML4 | XHTML | HTML5 |
---|---|---|
Do not code the xmlns attribute in HTML4. | xmlns attribute is required | xmlns attribute is NOT required as it is optional in HTML5. |
Attributes used with <html> tag
For HTMl4 & HTML5, you do not require any additional attribute for this element.
But, for XHTML, it is required to code the xmlns attribute. This simply tells that the html document has the xml namespace. By default, xmlns attribute take a value as –
xmlns=http://www.w3.org/1999/xhtml
Note/Warning/Info If you do not code the xmlns attribute in the XHTML document, the W3 Validator will not give any error as the validator adds "xmlns=http://www.w3.org/1999/xhtml" by default.
Supporting Browsers
Related Tags
All the major tags are coded under this tag.