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 trialBrandon Loyd
9,844 PointsMore 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.
http://teamtreehouse.com/library/more-pseudoclasses
"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;
}
Thanks!
2 Answers
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:
input[type="radio"]
...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!
Best,
J.T.
P.S. - The rest of your selector looks good; just fix the space issue! Best of luck!
novice J
Courses Plus Student 2,551 PointsHad the same issue but I solved it. My mistake was putting a colon before input!