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

CSS Advanced Selectors, 1st Challenge task 2

I might just be too tired... but I can't see what's wrong

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

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

3 Answers

Don't forget the hashtag "#" before the HEX code (#ff6347).

It's the hashtag.

Derek Etnyre
Derek Etnyre
20,822 Points

Believe you need to put an n after the 3 - like this:

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

This would select every 3rd child.

Thanks guys. I should never code when tired..... : )