CSS Margin Property

The CSS Margin Reference covers the use of Margin. Includes useful Example, and some background information.

The CSS margin property, is the short-hand way of specifying margin in css.

In web design, margin is generally used to apply white space between elements.

Possible Values

Using CSS margin

This example sets the margin in the following format: Top Right Bottom Left.

p {
  margin: 1em 2em 4em 3em;
}

The above is the equilivant of:

p {
  margin-top: 1em;
  margin-right: 2em;
  margin-bottom: 4em;
  margin-left: 3em;
}

Inherited? NO!

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.