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

rajbee
rajbee
6,657 Points

Incorrect arrangement of images

In the video, at 9:30, we see that the images are arranged incorrectly when the screen is reduced to a certain size. Why is the 4th image (num 9) placed under the third and not below the 1st one ? What is the meaning of "clear" the 4th image ?

3 Answers

I'm having trouble with this as well. I tried adding padding to each of the gallery list elements for the bottom to make sure the captions had enough room without bumping into the 4th elements but it didn't work.

Maybe HTML/CSS changed since the video came out.

Never mind, I seemed to have solved it. I had originally added a comment in my gallery section as such:

#gallery li:nth-child(4n){ 

/*COMMENT*/

}

Only when I tried removing the comment, did the content on my webpage work as responsively as it did in Nick's example. Hope that helps somebody.

i'm having the same problem, I was so impressed I had done something so cool and its buggered up! not a happy bunny now :(

Henry Welsch
Henry Welsch
4,587 Points

I believe in the video he makes reference to this: at certain screen sizes, the 4th element runs into the caption text from the 1st element and the "float" means that the 4th element is trying to float around that caption text. Clearing the 4th element circumvents that, and allows everything to flow correctly again.