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

HTML

Need help child selector question

Question: Use a Child Selector to select the anchor element that is a direct child of the div. Set its color to green and the font weight to bold.

Please don't tell me to watch the video AGAIN. If I get the message "Recheck Work" again, I might just punch my monitor.

This is my code: Please let me know what I am doing wrong.

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

3 Answers

Oops! I just realized my problem.

I had my code in the script tag.

I should have had it in the style tag.

Try this:

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

If that doesn't work could you give a link to the code challenge.

Sorry I guess I'm having a bad day. Should have posted this in the CSS section.

This worked for me, (I don't know why but it looks exactly the same to me):

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

Hope that helps.

I copied the code you have and it still don't work for me. Where are you putting the code?

alt text