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

Domnick Knowlton
Domnick Knowlton
1,904 Points

Will you help me with this code challenge?

Okay, I have already spent about 45 minutes messing with the code, so will you please help? Also, sorry to say but, :nth selectors are not my speciality in CSS. Here is the link.

http://teamtreehouse.com/library/pseudoclasses-nthchild

5 Answers

Sam Page
Sam Page
1,170 Points

For number 4 do:

li:nth-child(even) {
    background-color: black;
    color: white;
}
li:nth-child(3) {
    background-color: #FF6347;
}
li:nth-child(-n+4) {
    font-weight: bold;
}
li:nth-child(n+5) {
    font-size: 30px;
}
Sam Page
Sam Page
1,170 Points

Try:

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

I am also stuck on this one and unable to pass step two asking me to make the 3rd line background the hex color FF6347. the first line of code passed the challenge but the (nearly identical?) second rule is refusing to go through.

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

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

Sam Page
Sam Page
1,170 Points

I re-did the second part and passed with this code:

li:nth-child(even) {
    background-color: black;
    color: white;
}
li:nth-child(3) {
    background-color: #FF6347;
}
Sam Page
Sam Page
1,170 Points

This is the third part of the challenge:

li:nth-child(even) {
    background-color: black;
    color: white;
}
li:nth-child(3) {
    background-color: #FF6347;
}
li:nth-child(-n+4) {
    font-weight: bold;
}