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 trialAris Gysel
Python Web Development Techdegree Student 2,707 PointsWhen I shrink the browser there is a blank space in row 2 column 1 of gallery. It did not do that at first
When I shrink my browser the first image in row two pops on the right side and leaves a blank space. It did not do that at first. Only when I played around with the code.
Here is my code
/********************************* PAGE: PORTFOLIO **********************************/
gallery {
margin: 0; padding: 0; list-style: none; }
gallery li {
float: left; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: #bdc3c7;
}
4 Answers
Nick Janes
5,487 PointsWe're targeting the id gallery not the element gallery, so don't forget your pound symbols!(:
#gallery {
margin: 0;
padding: 0;
list-style:
none;
}
#gallery li {
float: left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
Aris Gysel
Python Web Development Techdegree Student 2,707 Pointsthank you for the fast answer. somehow it did not show the pound sign on my last post. but in fact there i put it there. here again my code.. I dont see any difference to yours.
gallery {
margin: 0; padding: 0; list-style: none; }
gallery li {
float: left; width: 45%; margin: 2.5%; background-color: #f5f5f5; color: #bdc3c7;
}
Aris Gysel
Python Web Development Techdegree Student 2,707 Pointshmm it cut of the pound signs again.. but in the original code they are there..
Nick Janes
5,487 PointsMake sure you're saving the file before you preview too!
Aris Gysel
Python Web Development Techdegree Student 2,707 Pointsi just realized when i make the text below the image shorter it does not happen. it seems as soon the text has to go into two lines it increases the "box" and this "box" pushes the image away. if i shorten the text and the text stays on one line it does not happen... any idea why this happens?
Nick Janes
5,487 PointsCan you take a screenshot of it or something?
Aris Gysel
Python Web Development Techdegree Student 2,707 Pointsyeah if i knew how to upload an image.. :D :@
Nick Janes
5,487 PointsI'm sorry, I'm out of ideas.
Dian Zhang
508 Pointssame problem here...
Have you figured out why not two pics in one line?
Aris Gysel
Python Web Development Techdegree Student 2,707 PointsI found out that if the text goes on for two lines it pushes down the image. With a shorter text or smaller font the problem does not appear. I would still like to know why this happens though