Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed CSS Selectors!
You have completed CSS Selectors!
Preview
In this video, we'll cover the :root and :target pseudo-classes. :root selects the highest-level parent element in a document, and :target selects an element when it's the target of a link.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
What root does for us, is it selects the
element that is the root of the document,
0:00
or the highest level parent.
0:01
Now, in an HTML file, this will usually be
the HTML element,
0:03
because as we can see, it is in fact the
topmost element in the document.
0:07
So, let's go over to our CSS directory,
and open up the style.css file.
0:12
And, in our style sheet,
0:18
we're going to create a root pseudo class
by typing colon, followed by root.
0:20
[BLANK_AUDIO]
0:25
And let's give this rule, a background
property, and
0:28
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up