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!

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 Going Further with Attribute Selectors and Pseudo-Classes Element States Pseudo-Classes

karan Badhwar
.a{fill-rule:evenodd;}techdegree seal-36
karan Badhwar
Web Development Techdegree Graduate 18,135 Points


When we did add the + label so why it isn't effecting all the adjacent label, they all are siblings we it just did change the font-weight of the just next one

1 Answer

It's not affecting all siblings because you're using the + combinator, which is the Adjacent sibling combinator. This means that it matches the second element only if it immediately follows the first element. Example: h2 + p will match all <p> elements that immediately follows <h2> element. (Information is from MDN topic on CSS Selectors. Page can be found here)