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 trialPrafful Gupta
1,368 Pointsnth child selector in responsive design video
Instead of 4n, argument should be 3n+1, because 1st element of 2nd row is 4th but 1st element of 3rd row is not 8th but 7th.
1 Answer
James Barnett
39,199 PointsCheck out the Teacher's Notes section below the video.
Instead, we want to select the first item in each row. A more robust solution is to use the selector
:nth-child(3n + 1)
instead. This will select every 3rd item plus 1. In other words, this will select the 4th item, 7th item, 10th item, and so on.