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 trialK. Brice Perez
15,095 PointsI 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; }
<!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>
/* Complete the challenge by writing CSS below */
ul: first-child {
color: white;
background-color:black;
}
1 Answer
Ryan Duchene
Courses Plus Student 46,022 PointsYou 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;
}
K. Brice Perez
15,095 PointsK. Brice Perez
15,095 PointsThanks! Kudos!!
Ryan Duchene
Courses Plus Student 46,022 PointsRyan Duchene
Courses Plus Student 46,022 PointsGlad I could help. Happy coding!