출처: http://www.w3schools.com/css/css_margin.asp



The CSS margin properties define the space around elements.


Margin

The margin clears an area around an element (outside the border). The margin does not have a background color, and is completely transparent.


The top, right, bottom, and left margin can be changed independently using separate properties. A shorthand margin property can also be used, to change all margins at once.

Possible Values

ValueDescription
autoThe browser calculates a margin
lengthSpecifies a margin in px, pt, cm, etc. Default value is 0px
%Specifies a margin in percent of the width of the containing element
inheritSpecifies that the margin should be inherited from the parent element

Remark It is possible to use negative values, to overlap content.



All CSS Margin Properties

PropertyDescription
marginA shorthand property for setting the margin properties in one declaration
margin-bottomSets the bottom margin of an element
margin-leftSets the left margin of an element
margin-rightSets the right margin of an element
margin-topSets the top margin of an element



CSS Margin

Specify margins for an element
The margin shorthand property
Set the top margin of a text using a cm value
Set the bottom margin of a text using a percent value
Set the left margin of a text using a cm value


Margin properties explained

'개발관련 > CSS/CSS3' 카테고리의 다른 글

[CSS]CSS Advanced - CSS Grouping and Nesting  (0) 2012.10.23
[CSS]CSS Box Model - CSS Padding  (0) 2012.10.23
[CSS]CSS Box Model - CSS Outline  (0) 2012.10.23
[CSS]CSS Box Model - CSS Border  (0) 2012.10.23
[CSS]CSS Box Model - CSS Box Model  (0) 2012.10.23
Posted by 파노카페
: