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 Foundations Advanced Selectors UI Element States Pseudo-Classes

Thomas Weld
Thomas Weld
12,293 Points

I don't get it? "use a combinator to target the label that is an immediate sibling of a radio button. "

I've looked up other Q&A on this same question.. it looks like I've got the same code and it's not accepting it ?? Also, I just don't understand how "label" is selecting immediate sibling of a radio button...

Thomas Weld
Thomas Weld
12,293 Points

Here is the CSS -- it's telling me, make sure I've set font weight to 'bold' ???

:disabled { background-color:lightgray;}

input[ type="radio"]: checked + label { color:blue; font-weight:bold; }

Thomas Weld
Thomas Weld
12,293 Points

Also, I just don't understand the statement and what exactly I'm doing by using "label" .. how does this select an immediate sibling of a radio button?

1 Answer

Hi Thomas,

You have a space before checked

Should be `input[ type="radio"]:checked + label { color:blue; font-weight:bold; }

It might help to look at the html.

<input name="radio" id="radio1" type="radio"><label for="radio1">Option 1</label>

The label is an immediate sibling to the radio button. It comes right after it. The challenge is trying to get you to select that label.

You can do this with the + combinator which is the immediate sibling combinator.

There are other labels in the html for phone and name but they won't be selected because they're not immediate siblings to a radio input.

Thomas Weld
Thomas Weld
12,293 Points

Ok, that makes more sense. Thanks for the explanation Jason.

You're welcome.