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 trialThunthon Monkata
Courses Plus Student 2,395 PointsUsing :nth-child pseudo-class to target even list items (CSS)
I'm stucked in Challenge task 1 of 4. It said "Use the :nth-child pseudo-class to target the even list items only. Set the color to white and the background color to black." When I clicked check work, it poped up "Bummer! Check the selector in your CSS. Make sure you set background-color to black." What am I missing?
Here is my code
li:nth-child (even) {
color: white;
background-color: black;
}
Thanks
4 Answers
Christian Andersson
8,712 PointsTry removing that whilespace between child
and (even)
. Like this:
li:nth-child(even) {
Kenneth Marks
4,703 Pointstry getting rid of the space between nth-child and (Even)
Christian Andersson
8,712 PointsThat timing though :)
Thunthon Monkata
Courses Plus Student 2,395 PointsThank a lot! :D Christian Andersson Kenneth Marks
Alexander Melo
4,297 PointsYeah for Pseudo classes, white spaces can alter the code.
Kenneth Marks
4,703 PointsKenneth Marks
4,703 Pointsjinx.