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 trialKeivan Norouzi
4,513 PointsI didn't fully get the last part, why "every" 4th item needs to be clear of float? Could anyone explain it to me please?
.
1 Answer
Damien Watson
27,419 PointsHi Keivan,
The pictures are set to float left, which means each proceeding images left edge will be on the same line as the element before as long as there is space enough. The design requires only 3 items to be displayed per line in the desktop view, so the 4th item needs to start on a new line. To stop it from floating on the same line as the first 3, you need to clear the float so it doesn't float next to the 3rd item.
Without 4th item clear
X X X X X X X X X
With 4th item clear
X X X
X X X
X X X
Keivan Norouzi
4,513 PointsKeivan Norouzi
4,513 PointsHi Damien,
Thank you so much for your comprehensive reply, now I've figured out what is happening.
Damien Watson
27,419 PointsDamien Watson
27,419 PointsCool, glad to help. :)