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

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

A CSS Selector

First time to see a selector like this:

label.light {

}

Can someone please clarify it to me?

eslam said
eslam said
Courses Plus Student 6,734 Points

label.light will select the label tag that has a class of light

Nour El-din El-helw
Nour El-din El-helw
8,241 Points

Oh! So that's like a more specific class selector? Like instead of selecting all elements with the light class it only selects the label element that has the class light. Am I right?

1 Answer

Steven Parker
Steven Parker
231,261 Points

You're right, that's a "combined selector" that uses both the tag name "label" and the class name "light". It will only match elements that have both.