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 trialJulian Ng
3,497 PointsI 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
5,676 Pointsin your html is the label tag a sibling of the radio button?
<input type="radio">
<label for=""> hello</label>
Jason Anello
Courses Plus Student 94,610 PointsHi 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;
}
Julian Ng
3,497 PointsCool! that solved the problem! Thanks Jason :)
Julian Ng
3,497 PointsJulian Ng
3,497 PointsYes it does, thanks for the help :D