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 trialMayank Sapra
4,555 PointsHow to change top and bottom margin to 0 and left and right margins to 10px?
In one of the code challenges related to CSS it has been asked to right the rule that changes the top and bottom margin to 0 and left and right margins to 10px wide. Is there anything wrong with this rule ?
nav li{ margin : 0 10px; }
3 Answers
Sergey Podgornyy
20,660 PointsApply this rule to unordered list:
nav ul{ margin : 0 10px; }
Tim Larson
Full Stack JavaScript Techdegree Student 13,696 PointsRemember when setting margins it works in a clockwise orientation, meaning value 1 is top value 2 is right 3 is bottom and 4 left. Applying this concept you could potentially achieve your goal by setting
nav ul { margin: 0px 10px 0px 10px; }
Good luck to you!
Mayank Sapra
4,555 PointsThanks Sergey and Tim it worked I realized I overlooked the question, it was unordered list I was supposed to write the rule for instead of ordered list.
Tim Larson
Full Stack JavaScript Techdegree Student 13,696 PointsAh, nice work then! Keep at it!