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

CSS How to Make a Website Styling Web Pages and Navigation Style the Portfolio

Brianna Lewis
Brianna Lewis
1,193 Points

I just finished the video for "Style the Portfolio", but my code isn't changing my picture sizes to 45% like the video?

Can someone review my code and see if I did something wrong?

Here is my css file part:

/***************
PAGE: PORTFOLIO
***************/

#gallery {
  margin: 0;
  padding: 0;
  list-style: none;
}

#gallery li {
  float: left;
  width: 45%;
  margin: 2.5%;
  background-color: #f5f5f5;
  color: #bdc3c7;
}

And this is the only change I made to my html file:

<ul id="gallery">

Thank you!

6 Answers

Hi Brianna,

Further up in the css file do you have something like this:

img {
  max-width: 100%;
}

This is to make sure the images don't overflow their container.

If it's not a problem with this then I would suggest you post your entire css file and also describe what it looks like if not in 2 columns.

Hugo Paz
Hugo Paz
15,622 Points

YOur html is not showing, could you please post it again?

Brianna Lewis
Brianna Lewis
1,193 Points

I can't get it to paste into the comment. Literally, the only change I made is the one shown above to identify it as "gallery". I completed the code challenges using the exact same coding and got them correct so I don't know if it's something I did wrong or a bug. Thanks for your help!

Hugo Paz
Hugo Paz
15,622 Points

Looking at the files on that course, it should work. Might be something else in the code. Are the other styles on your css applied to the page?

Damian Barabino
PLUS
Damian Barabino
Courses Plus Student 4,581 Points

I don´t know if you´ve already solve this, anyhow pls make sure that the id "gallery" is assigned to the correct <ul> on your html file. I.E the <ul> inside <section> and not the one inside <nav>

Damian Barabino
PLUS
Damian Barabino
Courses Plus Student 4,581 Points

RE POSTING as it seems i can´t use some symbols... when replying (guess i´ll have to check that markdown cheatsheet...)

I don´t know if you´ve already solve this, anyhow pls make sure that the id "gallery" is assigned to the correct ul on your html file. I.E the "ul" inside "section" and not the "ul" inside "nav"