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

Nazar Korotyuk
Nazar Korotyuk
4,210 Points

I cant seem to set all the margins to zero, I used the code "margin: 0;" it doesn't work?

I've tried margin: 0; and also tried margin-top: 0; margin-bottom... and so on but it doeskin work, it tells me that it looks like at least one side is set to zero and the others need to be too.

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

ID gallery {
  padding:0%;
  list-style-type: none;
  margin: 0;
}

1 Answer

Erik McClintock
Erik McClintock
45,783 Points

Nazar,

The issue is how you're trying to select the element with an ID of gallery. To target an ID in CSS, you use the pound sign (#). You're currently writing 'ID'. Additionally, remove the % sign from your padding declaration. Unfortunately, the challenges don't always give very helpful hints when there is an error, and that is the case here with it telling you there's a problem with margin property. You have written that correctly; it is the other two things I mentioned that are causing the task to fail.

You have:

ID gallery {
  padding:0%;
  list-style-type: none;
  margin: 0;
}

You want:

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

Try that and see if you're able to progress. Make sure you root these basic selectors in your memory; you will use them constantly in your web development career!

Erik