CSS Margin, top, bottom, left, right
The margin attribute sets "as the name says" a distance beyond the previously set boundary. The defined edge will not have any color, in other words it will be transparent. The CSS margin properties are used to create space around boundary, outside of any defined borders.
Margin - Individual Sides as top, right, bottom, left
All the margin properties can have the next value:
- length - specifies a margin in px, pt, cm, etc. for top, bottom, left, right,
- % - specifies a margin in % of the width of the containing element for top, bottom, left, right,
- inherit - specifies that the CSS margin should be inherited from the parent element,
Note: Negative value for margin are not allowed for CSS margin-top, margin-right, margin-bottom, margin-left
If the margin property has this four value:
margin: 12px 15px 12px 16px;
top margin is 12px
right margin is 15px
bottom margin is 12px
left margin is 16px
Example:
div-box1 {
margin: 12px 15px 12px 16px;
}
CSS margin - Shorthand Property
The css margin property is a shorthand property for the following individual margin properties:
margin-top is 12px
margin-right is 15px
margin-bottom 12px
margin-left 16px
Example:
If the margin property has three values:
div-box1 {
margin: 12px 15px 12px 16px;
}
margin: 12px 15px 14px;
top margin is 12px
right and left margins are 15px
bottom margin is 14px
Example:
If the margin property has two values:
div-box2 {
margin: 12px 15px 14px;
}
margin: 15px 20px;
top and bottom margin are 15px
right and left margin are 20px
Example:
If the margin property has one value:
div-box3 {
margin: 15px 20px;
}
margin: 16px;
all four margins are 16px
Example:
div-box4 {
margin: 12px;
}
CSS Margin auto alue
Example:
div-box5 {
width: 320px;
margin: auto;
border: 1px solid blue;
}
width: 320px;
margin: auto;
border: 1px solid blue;
}
CSS margin top, margin bottom, margin left, margin right, css margin 0 auto
CSS Margin, top, bottom, left, righ, auto - css tutorial
Online Editor
This tool makes it easy to create, adjust, and experiment with custom colors for the web.
HTML Templates

Magnews2 is a modern and creative free magazine and news website template that will help you kick off your online project in style.
CSS HTML Layout

Find here examples of creative and unique website layouts.
Free CSS HTML Menu

Find here examples of creative and unique website CSS HTML menu.