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

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