HTML - HTML element (Document root)


The html 1) element represents the root of a a html document (page).

It would become also the root (top node) in the in-memory tree representation (DOM document) of this html page.


This is also the node where all default sizing related styling are set such as:

normalize stylsheets applies their rule on it.

Why ? Because of CSS inheritance and because this is the top node, all descendant nodes inherit also this default values.


With javascript, you can get the Html DOM element via the documentElement property.


console.log("The name of the documentElement is "+document.documentElement.localName);

Powered by ComboStrap