margin

Support Key: [CSS1|CSS2|CSS2.1] [IE3|N4B3|O3.5|S1]
Other Margin Properties
margin-top
margin-right
margin-bottom
margin-left
= Index DOT Css by Brian Wilson =
  Main Index | Property Index | CSS Support History | Browser History  



   Quick Statistics   
Default Value:
   NA
Applicable Elements:
ALL
Inherit From Parent:
No
Applicable Media:
Visual
HTML Equivalent:
NA
Official Docs:
CSS1: Sect. 5.5.5
CSS2: Sect. 8.3, CSS2.1: Sect. 8.3
What is it?
This is a shorthand property which allows an author to specify 'margin-top', 'margin-right', 'margin-bottom', and 'margin-left' properties using a single property and value notation (the values are given in this order separated by spaces.) If one or more of the values are not present, the value for a missing side is taken from the opposite side that is present. If only one value is listed, it applies to all sides.

CSS margins are transparent and the background value of the parent element shines through. Negative values are allowed for each margin value of this property, which opens the way for text overlays to be created.

Allowed Values
inherit
[CSS2|CSS2.1] [N6|O7|S1]
Type: Explicit
Description:
Explicitly sets the value of this property to that of the parent.
auto
[CSS1|CSS2|CSS2.1] [IE3|N4B3|O3.5|S1]
Type: Calculated
Description:
This value specifies that a value determined by the browser be used for this property.
[length]
[CSS1|CSS2|CSS2.1] [IE3|N4B3|O3.5|S1]
Type: Explicit
Description:
Refers to either an absolute measurement or a relative measurement based on the current element's font size.
[percentage]
[CSS1|CSS2|CSS2.1] [IE3|N4B3|O3.5|S1]
Type: Calculated
Description:
Refers to a percentage of the width of the current element's containing block.
Syntax
Selector { margin: auto | [length] | [percentage] {1,4} }
Example
Ext/Doc: body { margin: 5px 0px 2px 25px }
In-Line:  <body STYLE="margin: 5px 0px 2px 25px">this is a test display document</body>
Browser Peculiarities

Boring Copyright Stuff....