I need to know what is the use of <html> tag from the beginning of the webpage although website runs perfectly without these <html> </html> tags.
I knew that doctype is required but why this <html> tag is required.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
<html>tag is not required.From the DTD:
The two
Os indicate that the start and end tags (respectively) are optional.The element, on the other hand, is required (but the language is designed so that browsers can imply it).
Since a DOM consists of a tree of nodes, you have to have one node (the root element) for everything else to hang from, and that is the html element.
It is also a really useful place to stick a
langattribute that will apply to the entire document.