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 trialmatthewroller
2,159 PointsHow do I set a margin of zero to the top and bottom?
How do I set a margin of zero to the top and bottom of the page. Last I left off was top, right, bottom, left to set margins.
I thought the answer to this would be..
nav ul { margin: 0, 10px, 0, 10px; }
2 Answers
Stephanie Raumschuh
17,582 PointsNo commas nav ul { margin: 0 10px 0 10px; }
Or you can use the shorthand version nav ul { margin: 0 10px; }
Clinton Hopgood
7,825 PointsI good way to think of it is like a clock, you start at the top and go clock wise.
nav ul {margin: 0} /* all sides */
nav ul {margin: 0 10px} /* margin 0 top and bottom and margin 10px left and right*/
nav ul {margin: 0 10px 0 10px} /* Same as the one above but each side set */