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

Matthew Ashman
Matthew Ashman
4,364 Points

"Having trouble setting (all) margins to 0"

I have attempted to set margin to zero multiple ways, but can't seem to figure it out:

gallery id{

margin: 0; padding: 0; list-style: 0; }

I have also tried:

margin: 0 0 0; margin: 0 auto; margin 0px;

Any help and explanation is appreciated, thank you!

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hello again...

Your first try was very close. However, your selector is a bit off. You want to select the id of "gallery" which is done by #gallery. Your margin property is correct, and your padding property is correct; however, you don't quite have the list-style property right. To remove the bullet points, you need list-style: none;, instead of list-style: 0;

:smiley:

Matthew Ashman
Matthew Ashman
4,364 Points

Thank you again Jason:

When the question said to id gallery - that threw me off - and I entered my code as:

gallery id{ /****** instead of #gallery******/

margin:0; padding:0; list-style:none; }

Thanks for helping a Treehouse noob out, he appreciates it!

Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

No worries.

I was where you are not too long ago, and I was very appreciative of the help I got from others back then. Now I am happy that I can pay-it-forward and help others now.

Keep Coding!