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 CSS: Cascading Style Sheets Center the Wrapper

Question on margin property?

css margin: 0 20px; is equivalent to css margin: 0 20px 0 20px;

Can anyone here explain me how right margin function? I set ```css margin: 0 20px 0 0; but I do not see any changes on web page.

It seems it only works for left , top and bottom margin.

2 Answers

Saulius K
PLUS
Saulius K
Courses Plus Student 15,928 Points

A right margin functions in the same way a left, top and bottom margin does.

Please post the context of the code you are working with, so we can help you out.

Could it be that you don't have anything to the right, so you visually cant see that the margin is there yet?

margin: top&bottom left&right;
margin: top right bottom left;

What you wrote should be giving whatever element you assigned it to a right margin of 20px, unless some other element is interfering with it later on in your code.