Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
CSS Selectors1:30 with Joy Kesten
Learn about the difference in CSS selectors, what the C in CSS means, and why rules don't always cascade.
In this video, we're gonna be talking about selectors, and why the .car selector
is different than the other selectors, we're using in our style sheet.
Let's check it out.
Moving down the CSS page, I wanna introduce you to the .car selector.
This kind of selector, is not like an element selector.
Like a body selector.
The .car selector is called a class selector.
And when you look into the HTML document for
the class car, you find it here in our image tag.
Because the class selector car is more specific,
than just anything inside the body.
I could technically, put this whole bit of code above the body, and
everything should work out exactly the same.
So, I'll save it out, and refresh the page, and nothing's changed.
I'll put it back where it was, just so
I keep everything in the right spot, and don't get confused later on.
But keep in mind, that if you have a more specific selector rule,
like a class selector it's going to override a more general selector rule,
like element selector no matter what the position.
That about wraps it up for our style sheet.
Keep changing things to make it your own.
Also, try writing in some new rules under each selector.
how it's going to help our buttons make sounds?
You need to sign up for Treehouse in order to download course files.Sign up