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 Make a CSS Image Gallery

I had set the color and background for #gallery li, but still not passing it.

I had set the color and background for #gallery li, but still not passing it.

css/main.css
a {
  text-decoration: none;
}

#wrapper {
  max-width: 940px;
  margin: 0 auto;
}

#logo {
  text-align: center;
  margin: 0;
}

h1, h2 {
  color: #fff;
}

nav a {
  color: #fff;
}

nav a:hover {
  color: #32673f;
}

h1 {
  font-family: β€˜Changa One’, sans-serif;
  font-size: 1.75em;
  font-weight: normal;
}

img {
  max-width:100%; 
}
#gallery {
  margin:0;
  padding:0;
  list-style:none;
}
#gallery li {
  float:left;
  max-width:45%;
  margin:2.5%;
  color:#000000;
  background:#998977;
}
jason chan
jason chan
31,009 Points

did you include the id="gallery" in the index.html file and the other html files.

Please add your HTML code to the question so we can see where the id is set.

Samuel Webb
Samuel Webb
25,370 Points

There is no HTML code, it's a code challenge that doesn't have HTML attached in a way that you can alter.

3 Answers

Samuel Webb
Samuel Webb
25,370 Points

It seems like the test for this is checking if the font is any color other than black. So you're failing the test because you're choosing a pure black text color. I tested this code and it worked:

#gallery li {
  float: left;
  max-width: 45%;
  margin: 2.5%;
  color: #111;
  background: #998977;
}
Erin Fitzsimmons
Erin Fitzsimmons
3,198 Points

The default color is already black, so you're not changing anything. If you specify at the beginning of the CSS that all li within the HTML are some other color (li {color:blue;}) then it becomes necessary to change the text color later if you want a different color in a different list. But from the code you posted, you did not.

I just did the challenge and this code worked for me

gallery li {

float: left; width: 45%; margin: 2.5% 2.5%; color: #fff; background: #222; }