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

Nancy Melucci
PLUS
Nancy Melucci
Courses Plus Student 36,143 Points

Removing margin on all sides

For a code challenge....

Hello everyone -

It seems that nothing works

gallery {

margin:: 0;

}
have also tried: margin: 0, 0,
margin: 0, auto;
margin: 0 0 0 0;

thanks

Nancy, I went ahead and fixed your code highlighting. Below is a animated image to help show how code highlighting works on the Treehouse forum. Let us know if there's anything else we can help with.

Posting Code on the Treehouse Forum

4 Answers

Hi Nancy, you need to select the gallery ID using the # symbol in front like this:

#gallery {
  margin: 0;
}

This should just be all you need.

gallery {
    margin: 0;
}

Best of luck with the challenge.

Nancy Melucci
Nancy Melucci
Courses Plus Student 36,143 Points

Thanks for the fast response. That's what I've been coding but it comes back: "looks like at least one side has no margin. be sure set all sides to zero margin. Here's the whole task

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

}

No problem. Please could you paste the question into here for me to take a look at?

It should be working so I'm confused as to why it's not.

Is "gallery" a class or an ID? If it's a class, you have to put a . before gallery. If it's an ID, you have to use a #.

While it's not best practice, you could also try to use margin: 0 !important;