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

Mateusz Filipek
Mateusz Filipek
1,538 Points

I cannot figure out what seems to be the problem with my margin settings.

The task seems complete to me. I have set both margin and padding to zero and I have cleared out the bullet points with list-style. However, the debugger keeps suggesting that not all sides of the margin are cleared. Am I missing something here?

Thanks for your time, Matthew

css/main.css
#gallery img {
max-width: 100%;
margin: 0 0 0 0;
padding: 0;
list-style: none ; 
}


a {
  text-decoration: none;
}

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

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

1 Answer

Cory Harkins
Cory Harkins
16,500 Points

In the challenge, it asks that you target all images to fill their parent container, that would mean creating a rule to govern their appearance as a single declaration.

The next challenge asks, that you target the #gallery itself, and add rules to that.

In your declarations/rules, you aren't necessarily wrong, as you can select images using descending selectors (#gallery img { styles-go:here; } )

However you must apply the margin: 0; padding: 0; and list-style-type: none; to the #gallery itself (parent OF the img)

Like so:

img {
  max-width: 100%;
}

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

I hope this helps in clarifying! Good luck!