I have just recently started using NetBeans IDE (6.9.1) and have used it to add a stylesheet to my site-in-progress.
To my surprise, one element was automatically added:
root { display: block; }
Looking around, I could find some information about the :root
pseudo-class but nothing about the root
element itself.
What is the root
element and does it have any use?
The <html> HTML element represents the root (top-level element) of an HTML document, so it is also referred to as the root element. All other elements must be descendants of this element.
There is no element called root in HTML. The html element itself is "the root element" (which is the term given to the element which is the ancestor of all the other elements in the document), but this would be matched by html { } . However, see the :root pseudo-class (with a colon).
The <html> element is the root element of the HTML page. The <head> element contains the document's metadata (including elements such as meta, title, style, script). The <title> element describes the title of the document. The <body> element contains the visible page content.
There is no element called root in HTML. The html element itself is "the root element" (which is the term given to the element which is the ancestor of all the other elements in the document), but this would be matched by html { }
.
However, see the :root
pseudo-class (with a colon).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With