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 Selectors Basic Structural Pseudo-Classes

I get the Bummer! message informing me to set my background-color to black. I have correct code, is this an error?

Please check....

ul: first-child { color: white; background-color:black; }

index.html
<!DOCTYPE html>
<html>
<head>
    <title>Structural Pseudo-Classes</title>
    <link rel="stylesheet" href="page.css">
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <ul>
        <li>First child of ul</li>
        <li>Second child</li>
        <li>Third child</li>
        <li>Fourth child</li>
        <li>Last child of ul</li>
    </ul>
</body>
</html> 
style.css
/* Complete the challenge by writing CSS below */
ul: first-child {
  color: white;
  background-color:black;
 }

1 Answer

You have everything right except for one thing. The colon in your pseudo-selector is in the wrong place. It should come right before first-child.

ul :first-child { /* notice the colon */
  color: white;
  background-color: black;
}

Thanks! Kudos!!

Glad I could help. Happy coding!