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 trialMichelle Wee
11,985 Pointsli:nth-child(4n) should be corrected to li:nth-child(3n+4)?
I think this correction should be made in the teacher's notes since li:nth-child(4n) is targeting the wrong elements to clear (4th, 8th, 12th, etc.). The list elements that should be cleared are the 4th, 7th, 10th, 13th, etc. In other words, every third list item starting from the 4th element. li: nth-child(3n+4) would be the correct pseudo-class to use in this case.
Michelle Wee
11,985 PointsThanks for the tip! :)
Sean Pascoe
17,151 PointsBachtiar Firmansyah , why do you say more robust? I understand in this case it doesn't hurt anything to clear the first li but why is 3n+1 better than 3n+4? Just curious. Thanks for your input.
Bachtiar Firmansyah
694 PointsBachtiar Firmansyah
694 PointsA more robust solution is to use the selector :nth-child(3n + 1)