Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Brandon Loyd
Brandon Loyd
9,844 Points

More Pseudo-classes - Task 4/4 in Code Challenge

Can someone help me with this last challenge? I can't see what I'm doing wrong.


"Create an attribute selector that selects input elements with a 'type' value of 'radio'. In the same selector use the :checked pseudo class, then use a combinator to select the label that is an immediate sibling of a checked radio button. Set the color to blue and the font weight to bold."

This was my answer:

input [type="radio"]:checked + label {

    color: blue;
    font-weight: bold;



2 Answers

J.T. Gralka
J.T. Gralka
20,126 Points

@Brandon -

Your issue stems from the fact that you include a space after the word input in your selector; if you would like to filter by the type radio button, you should write the first part of the selector like this:


...and not like this:

input [type="radio"]

Remember that whitespace can sometimes alter your CSS selectors, and in this case, adding the space between the name of your form element and the square bracket caused your selector not to work properly. Hopefully this helps!



P.S. - The rest of your selector looks good; just fix the space issue! Best of luck!

Had the same issue but I solved it. My mistake was putting a colon before input!