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 Selectors Using Combinators in Selectors

This appears to be the same as the right answers I have seen here, but gets an error message.

Create a child selector to target the anchor element that is a direct child of the div. Set its color to green and font weight to bold. Have tried it others ways, like without the "."div. ````

.div > a { color: green; font-weight: bold; }

6 Answers

Your answer works for me. But you have to do it without the ".". The dot is for classes and the div is an element.

I'm on a friends computer that has a somewhat messed up display so I'm not suere I'm seeing exactly what you typed or if I'm understanding the exact context, but it looks like you have a period in front of your div selector -- as in, class="div" -- is that what you intended?

Have tried it others ways, like without the "."div. ```` You are right that the period is wrong. But she already tried it without the dot.

My bad, sorry about that...like I said-- I can barely make out parts of the display. I'll do the smart thing and wait til I get back on a fully fuctioning computer.

Check other parts of your CSS. Maybe you miss a bracket etc. Happened to me more than once.

Hope you find the answer and get to move forward!

Actually, this answer (without ".") is just not working and I am unsure why. This is the second time that I've used my answer (that was also right according to others' feedback) and it will not pass. I above and here it is, cut and pasted. Again: ````

div > a { color: green; font-weight: bold; }

Hi Lee Ann,

I've taken your css here and pasted it into the challenge and it passes.

Maybe you need to refresh the challenge. It seems rare but occasionally other students have not been able to pass a challenge with correct code.

Best answer: Jason Anello!

Thank you so much! I felt nuts before seeing this.