2.5.1 Root

posted August 25, 2015

The html root element represents the root of the document. It has a start tag <html> and end tag </html>.

The root element contains all of the code for each web page. Specifically, the html root elements has the <head> and <body> tags within it which in turn has all the code and content of each web page.

So, at a minimum, you need the following elements to have a web page.

<!DOCTYPE html>
<html lang="en">
    <head>
    </head>
    <body>
    </body>
</html>
        

In addition, a common attribute used with the root element <html> is the lang attribute which specifies the language of the element's content.

In the example above, the <html> element has a lang attribute "en" which specifies that the document is in the English language. You can find an language reference on W3Schools.