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

HTML How to Make a Website Responsive Web Design and Testing Build a Three Column Layout

Chris Komaroff
PLUS
Chris Komaroff
Courses Plus Student 14,198 Points

Hi, is nth-child (4n) the best solution? Instead (3n+1) may be the correct formula if many more images were in list.

There are 3 columns displayed. You want to select the 1st (leftmost) image in each row: 1st, 4th, 7th, 10th ... image (I realize here there are only 5 images in this example). Then you clear left to make this the first element of each row clear the image caption text of the above row. The formula for this is 3n+1, not 4n. Am I missing something?

3 Answers

Hi Chris,

See the Teacher's Notes below the video. :)

Chris Komaroff
Chris Komaroff
Courses Plus Student 14,198 Points

Thank you, I did not check the notes last night. (3n+1) is the better solution.

Thank you very much Isaac for the mention.

Hi chris, 4n it's not the same as 3n+1 , for example:

3n+1 (3 x 0) + 1 = 1 = 1st Element (3 x 1) + 1 = 4 = 4th Element (3 x 2) + 1 = 7 = 7th Element etc.

4n (4 x 0) = 0 = 0 Element (4 x 1) = 4 = 4th Element (4 x 2) = 8 = 8th Element etc.

Isaac Asante
Isaac Asante
4,752 Points

Great insight John! It looks easy now.

Chris Komaroff
Chris Komaroff
Courses Plus Student 14,198 Points

Thanks, (4n) is not the same formula as (3n+1). I see the code correction in the notes that agrees with (3n+1) as best solution.

Thanks, that really helped me out!