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.

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.