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

Gary Ting
Gary Ting
9,167 Points

Can't get past last quiz, Selectors "Basic Structural Pseudo-Classes"

I can't figure out what I'm doing wrong with this first object. "Select the li that is the first child of the ul. Set the color to 'white' and background color to 'black'."

Here is the code I put in: li: first-child{ color: white; background-color: black; }

It always says: Bummer! Please check your selector, make sure background-color is set to 'black'.

Can anyone tell me what I'm doing wrong? Thanks in advance

3 Answers

James Barnett
James Barnett
39,199 Points

Here's a hint, in CSS selectors spaces are syntactically significant as its the combinator for a descendant selector.

With CSS selectors it's just like the Holy Hand Grenade from Monty Python, you must remember that 3 shall be the number of the counting.

Here are two hints without giving away the answer:

  1. check your selector, i.e. everything in front of the open curly;
  2. every character in the selector counts and has a meaning.

Hope this helps.

Gary Ting
Gary Ting
9,167 Points

Thanks James and John. I got it!