CSS CSS Selectors Advanced Selectors Advanced Selectors Review

Daven Hietala
Daven Hietala
8,040 Points

What is the top-most element in an HTML document called

What is the top-most element in an HTML document called?

I thought it would be called the ":first-child" or ":root". But according to the quiz I am taking this is not the case. I reviewed the video that was offered to review and still did not find the answer.

Please help

2 Answers

Click on :root - MDN in the teacher's notes of the linked video for:

In HTML, :root represents the <html> element and is identical to the selector html, except that its specificity is higher.

/* Selects the root element of the document: <html> in the case of HTML */

Daven Hietala
Daven Hietala
8,040 Points

Thank you Kris!

I clicked on the link to read through the MDN document and still did not see my answer for a while. I felt like it was telling me the same thing I already tried, ":root".

I didn't think the <html> tag would be considered the HTML element as well.

Anyways, I appreciate your time and showing me "how to find the answer on my own" vs. just telling me out right. Teach fish vs. give fish.

Have a nice day!