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

I think I put my code right, I can't see where I did wrong

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

2 Answers

David Omar
David Omar
5,676 Points

in your html is the label tag a sibling of the radio button?

<input type="radio"> 
<label for=""> hello</label>

Yes it does, thanks for the help :D

Hi Julian,

It's the 2 extra spaces that you have which are creating descendant selectors. With the space after input and a space before the : it's trying to match a checked element within an element that has a radio type within an input element.

It is ok to have spaces around the + combinator.

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

Cool! that solved the problem! Thanks Jason :)