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 trialAndres Sanin
6,631 PointsMinor correction
A minor comment: for a 3 column layout it would be better to use :nth-child(3n+1) instead of 4n. No impact here if you only have 2 rows but I guess it's better to learn it right from the start :)
1 Answer
Jason Anello
Courses Plus Student 94,610 PointsHi Andres,
The previous video introduced :nth-child(4n)
and the teacher's notes below that video has the correction.
You also need :nth-child(2n + 1)
or :nth-child(odd)
in main.css for the 2 column layout. Same problem exists there.
In main.css you need:
#gallery li:nth-child(odd) {
clear: left;
}
In responsive.css within the media query for the 3 column layout you need:
#gallery li:nth-child(odd) {
clear: none;
}
#gallery li:nth-child(3n + 1) {
clear: left;
}
You have to first remove the clear property from the odd items and then you can set the clear: left
on the correct items for a 3 column layout.