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 Style the Image Captions

About the 2.5% margin for the #gallery list items

Nick says that it will add 2.5% of margin space to both the left and right sides. But shouldn't it add 2.5% to both top and bottom as well since it's a short hand of the whole margin property (margin: top right bottom left;)?

4 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Sorry, this was actually just slightly unclear wording. It will indeed add 2.5% margin to both the left and right sides. What I did not mention and probably should have, is that it will also add 2.5% margin to the top and bottom. The margins on the two sides are the more important part of the explanation though, so that's why I mentioned it.

Logan R
Logan R
22,989 Points

Yes, from what I saw, it should add 2.5% to top, bottom, left and right. You can easily solve this by doing:

margin: 0 2.5%;

This would be margin: top/bottom left/right;.

sure sure. but my point is: why it didn't add 2,5% to top and bottom? It should right? He's declaring 2,5% to all sides but it didn't take effect on top and bottom.

Thanks Nick, that clarifies it all :)

and thanks L R for the quick response too.

now back to coding