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 Advanced Selectors Pseudo-Classes: :nth-child

Code challenge hangup

I got the first task correct which was: "Use the :nth-child pseudo-class to target the even list items only. Set the color to white and the background color to black."

The second task is: "Create a new rule that targets the 3rd list item only. Set the background color to the HEX value FF6347."

My CSS looks like this:

li:nth-child(even) { color: white; background-color: black; }

li:nth-child(3) { background-color: FF6347; }

It keeps telling me that the second task is wrong. Can somebody please tell me what I'm doing wrong here or if I'm missing something. Thank you in advance!

1 Answer

Kevin Kenger
Kevin Kenger
32,834 Points

Hey Andrew,

It looks like you just forgot to add the # in front of your hexadecimal value.