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 trialNathan Noye
4,370 PointsWhy is there a gap after the second photo when I use float: left;?
I followed the course and checked my code even googled for an answer but came up with nothing. Im doing something wrong but I can't find the answer. After my second photo on my site, I get this space another picture should be but nothing is there BUT the picture that should be there has moved over to the other spot. Any clue why it would do this?
Nathan Noye
4,370 Pointsimg { max-width: 100%; }
gallery {
margin: 0;
padding: 0;
list-style: none;
}
gallery li {
float: left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
Thanks for the quick answer man!
5 Answers
Hugo Paz
15,622 PointsNathan,
Try reducing the margin to 2% and adjust accordingly.
Saad Ahmed
7,090 PointsAlso if you can attach a screen shot of the webpage. I personally had the same problem in the beginning but its probably just the margins.
Nathan Noye
4,370 PointsHow would I post a picture on here? I tried dragging and dropping but unfortunately had no luck
Saad Ahmed
7,090 Pointstry using this in the comment box:
Nathan Noye
4,370 PointsI can't see what you posted :/
Hugo Paz
15,622 PointsHugo Paz
15,622 PointsHi Nathan,
Can you please your code here so we can help?