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 trialRandy Crowson
2,531 PointsFinally, create a new rule that targets the last 3 list items only. Set the font size to 30px.
Bummer! Check the selector in your CSS. Make sure font-weight is set to 'bold'.
:nth-last-child(-n+3) {
font-size: 30px;
}
6 Answers
Dave McFarland
Treehouse TeacherI think I see the problem. You need to supply the HTML element that you want to select. The challenge is asking you to select the last 3 LIST items. For example
li:nth-last-child(-n+3) {
}
Your code doesn't specify the li element
:nth-last-child(-n+3) {
}
Chase Lee
29,275 PointsRandy Crowson. This should work:
ul li:nth-last-child(-n+3){
font-size: 30px;
}
Michelle Pepe
Courses Plus Student 6,125 PointsRandy's right it's ul li:nth-last-child(-n+3){ font-size: 30px; }
Luca Dan
6,012 Pointsli:nth-last-child (-n+3){ font-size:30px; } it is not working why?
Mohamed Moujid
1,435 Pointsli:nth-child(n+5){ font-size: 30px; }
or
li:nth-last-child(1n+5){ font-size: 30px; }
Dave McFarland
Treehouse TeacherCheck the CSS property you're using in your code. It's not the one the question is asking for.
Randy Crowson
2,531 PointsI don't understand.