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

HTML How to Make a Website Styling Web Pages and Navigation Make a CSS Image Gallery

Casey Beaver
Casey Beaver
512 Points

Add 2.5% margin + set background and text colors to gallery(id) list items.

Below is my code--I'm not sure why I'm not passing this. When I click check work it says "be sure to set the color of your list items to a color of your choice." -- Am I not doing this correctly?

gallery li {

float: left; max-width: 45%; margin: 2.5%; color: #000; background: #333; }

Casey Beaver
Casey Beaver
512 Points

Nevermind, forget my # on gallery li!

2 Answers

Hello bro...you should use "background-color" property, not the "background" property Although both are similar...background-color is more SPECIFIC to the question asked

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

If this helped..please rate my answer