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 trialMatthew Comito
2,960 Pointsimages not lining up correctly
I'm on the section about floating images supplied by Nick. The 1st and 2nd images are side by side, but there's an empty space to the left of the 3rd image (image-number 6). The 4th (image 9) and 5th (image 12) images are side by side, The 3rd and 4th images should be side to side with the 5th by itself. Is there something wrong in my html or css? I can't seem to get my html to load on here.
Here's the css
gallery {
margin: 0; padding: 0; list-style: none; }
gallery li{
float:left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
3 Answers
Brian Gallagher
9,074 Pointsare you missing a space in float: left;
Jason Anello
Courses Plus Student 94,610 PointsSpaces after the colon are strictly for readability. It make no difference to the browser.
Matthew Comito
2,960 PointsHa! Thank you!
Adam Moore
21,956 PointsI didn't know that the space didn't matter; I hadn't really run across not putting spaces, as I put a space out of habit and I didn't check it myself to see if the space mattered.
Adam Moore
21,956 PointsThe CSS you have here looks right, and should put the list items side by side, two per line. If they are not showing up correctly, then there may be some problem with some other HTML or CSS settings that is throwing off the alignment. It may even be something as small as leaving off a closing "/" mark.
Adam Moore
21,956 PointsCrap, yeah, Brian, you are right, I missed that. :)
Brian Gallagher
9,074 Pointshaha, no problem. Cheers Adam
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsHere's how to post code in the forums: https://teamtreehouse.com/forum/posting-code-to-the-forum