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 trialChris Komaroff
Courses Plus Student 14,198 PointsHi, 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
Jason Anello
Courses Plus Student 94,610 PointsHi Chris,
See the Teacher's Notes below the video. :)
John Leskas
24,093 PointsThank you very much Isaac for the mention.
John Leskas
24,093 PointsHi 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
4,752 PointsGreat insight John! It looks easy now.
Chris Komaroff
Courses Plus Student 14,198 PointsThanks, (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.
davidg
10,128 PointsThanks, that really helped me out!
Chris Komaroff
Courses Plus Student 14,198 PointsChris Komaroff
Courses Plus Student 14,198 PointsThank you, I did not check the notes last night. (3n+1) is the better solution.