Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Selectors Advanced Selectors Advanced Selectors Review

Ryan Purcell
Ryan Purcell
14,039 Points

Why are ":root" and ":target" not the correct answers for a fill in the blank final review question?

"The top-most element of an HTML document is the ____ element. We're able to target that element with the ____ pseudo-class."

I've tried responding with "root" and "target" and couple variations of one part of the answer with a starting colon and then the other. Even the video title this question is reviewing is called ":root and :target". I've looked at the MDN page for each and they use single colons. The only thing I haven't tried is "HTML" and ":target", but if that is the correct answer, then I feel the question was poorly written. I'm sure it is something completely obvious that I'm missing (like those aren't the correct answers to begin with lol). Thanks.

1 Answer

Ryan S
Ryan S
27,276 Points

Hi Ryan,

The wording is a bit confusing but the top-most element is the <html> element itself, and ":root" is the pseudo-element that targets it.

:target is used to target the "href" value of anchor tags.

Hope this helps.

Ryan Purcell
Ryan Purcell
14,039 Points

Thanks! I knew I was trying to plug in the wrong data. I'd never used ":target" before and came back to the lesson after being interrupted. I knew you could "target", rather reference, the root element in an HTML file as ":root" but I just hadn't fully separated the concepts.