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

:nth child - is my code correct?

Hi, just doing the :nth child challenge and I think my code is right but it's coming up as wrong and I don't know why. Can anyone help? My code is:

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

Thanks, Simon

3 Answers

Tom Bedford
Tom Bedford
15,645 Points

I think you have an erroneous space before (even)

Edit: too slow and not as humorous

Patrick Gerrits
Patrick Gerrits
14,614 Points

The answer is somewhere in "space".....

Cryptic huh?

Thanks Patrick and Tom. It was indeed the space before (even). Always the little things...