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

William Riddle
seal-mask
.a{fill-rule:evenodd;}techdegree
William Riddle
Full Stack JavaScript Techdegree Student 3,918 Points

I don't understand why this isn't an acceptable answer for#3. #gallery li { float:left; width:45%; }

Thanks

css/main.css
a {
  text-decoration: none;
}
img {
  max-width:100%;
}
#gallery {
  margin: 0;
  padding: 0;
  list-style: none;
#gallery li {
    float:left;
    width:45%;
  }

}
#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;
}

3 Answers

Keith Kelly
Keith Kelly
21,326 Points

Building on what @andren said it looks like you do have the gallery rule closed, but you placed the gallery li inside the gallery rule. If you move the gallery li to after the gallery closing curly bracket I would suspect everything would be fine.

That is also the reason for the weird color change of the gallery li. When you see a color that looks off in your text editor, more often than not it indicates some syntax issue.

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

#gallery li {
  float:left;
  width:45%;
}
andren
andren
28,558 Points

Ops you are right it does seem like he placed the rule inside another rule rather than not closing it. I didn't notice the extra closing bracket at the end there.

I've upvoted your answer as it is more correct than the one I provided.

andren
andren
28,558 Points

Your "#gallery li" rule is fine, and will allow you to pass task 3. But you have forgotten to close the "#gallery" rule directly above it. It is missing a "}" closing bracket. If you add that above the "#gallery li" rule then your code will pass.