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

Pseudo-Classes – :nth-child - bug in challenge?

It will not let me pass on task 2 of 4 for this challenge - task 1 passed fine, task 2 asks "Create a new rule that targets the 3rd list item only. Set the background color to the HEX value FF6347."

So i add my css rule (which adds to the previous tasks rule)

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

li:nthchild(3) {
 background-color: #ff6347;
}

Any idea on how to get past it?

Thanks

Darren Kynaston
Darren Kynaston
Courses Plus Student 15,610 Points

Hi Garry,

You have simply missed typed the nth-child (you've missed the dash)

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

should work.

Kind Regards,

Darren.

2 Answers

Darren Kynaston
PLUS
Darren Kynaston
Courses Plus Student 15,610 Points

Hi Garry,

You have simply missed typed the nth-child (you've missed the dash)

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

should work.

Kind Regards,

Darren.

Wow - I'm such a fool!

how did I not notice that?!

Cheers