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

Some technical problem with code challenge?

I clear the 1st objective and move to the 2nd but on its completion it says the answer to my 1st objective is incorrect! Wondering what's going on?

(https://teamtreehouse.com/library/pseudoclasses-nthchild)

Dave McFarland
Dave McFarland
Treehouse Teacher

Sometimes, when you make a mistake on a later objective, the code challenges incorrectly say the problem is with an earlier step. Most likely your first objective is still correct, and the mistake is somewhere in your code for the 2nd objective. Can you post the code that's causing the problem?

4 Answers

I am using this code as answer to the 1st task:

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

and this one as answer to the 2nd:

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

Jahan Zeb -

When I use your code on step 2, it works just fine on Chrome under Windows 7.

Imgur

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Did you try background-color property?

Thanks dave for looking into it, but it is not able to pass even with 'background-color' property for me!

I just tried it on another web-browser with same issue!

Dave McFarland
Dave McFarland
Treehouse Teacher

Sorry it's not working. Are you getting the same error message each time?

I know this isn't much help, but I just tried it with your code and it worked (even worked with the regular background property). Try quitting your browser and restarting the challenge.

Thank you very much for your help Dave and James. I spotted the problem, it was my bad! I was not adding new css rule but only making changes in the first rule. So sorry for bothering you with this one!