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

How to interpret :nth-child(3n + 1)

This is my interpretation so please correct me if I don't comprehend this right or phrase it better.

For the element subsequent (which is the 4th li, 7th li, 10th li, etc..) to every other third element, we want to revert it back to a normal flow to prevent any formatting issues on each row in the div when resizing the browser. Take the 4th element. When the 4th element is reverted back to normal flow on a new line, the 5th and 6th elements still take on the float property. This sequence would repeat itself for each subsequent row.

Is that accurate?

2 Answers

Steven Parker
Steven Parker
243,656 Points

It sounds like you've got it. :+1:

This arrangement keeps the images in three columns as they wrap down the screen.

What would be other specific reasons for using :nth-child?