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 trialCecil Quist
2,851 Pointscss not working
i don't know what i'm doing wrong, but my css is not working. here's my code:
#gallery li {
float: left;
width: 45%;
margin: 2.5%;
background-color: #f5f5f5;
color: #bdc3c7;
}
Cecil Quist
2,851 Pointsyes, that's what I thought, but all my images are jumbled up. I don't know where I'm going wrong. I don't think it's a browser issue either.
Richard Duncan
5,568 PointsIs this a code challenge? cecil quist if so post the question and I'll see if I can help. If it's a personal website query post what you want the end result to be please.
James Barnett
39,199 PointsI'd suggest you make a codepen and then post the link in this thread. Make sure to include all of your HTML & CSS in the pen (on codepen) so we can see the bigger picture.
If I had to take a random guess, your HTML has an issue, and doesn't match up exactly with Nick's.
5 Answers
Nick Pettit
Treehouse TeacherHi cecil quist,
On line 19 of your CSS, you have a bad selector. Your selector says "image" when it should be "img" instead. Here's the corrected code:
img {
max-width: 100%;
}
I've forked your pen and added the hosted versions of the image assets (from treehousewebsite.com) so you can see what the correction should look like: http://codepen.io/nickpettit/pen/ajqhA
Hope that helps!
Cecil Quist
2,851 PointsNo it's not a code challenge, it's a practice code on "how to build a website" with Nick Pettit. "style the portfolio" I don't know if you can open this link, but here it is... thanks.
Richard Duncan
5,568 PointsQuite a lot going on here and I don't have time right now to watch the vid, have you tried re-watching it see if it makes more sense the second time around?
Cecil Quist
2,851 Pointsyes I have over and over to where it was last perfect. I will give it another shot. thanks.
Cecil Quist
2,851 PointsCecil Quist
2,851 PointsThanks Nick. Phew!
Richard Duncan
5,568 PointsRichard Duncan
5,568 PointsWhat's the question I can't see anything wrong witht he syntax.