| Property: |
margin |
| Values: |
<length>, <percentage>, auto |
| Initial: |
not defined for shorthand properties |
| Inherited: |
no |
The 'margin' property is a shorthand property for setting
'margin-top', 'margin-right', 'margin-bottom' and 'margin-left' at the
same place in the style sheet.
If four length values are specified they apply to top, right,
bottom and left respectively. If there is only one value, it applies
to all sides, if there are two or three, the missing values are taken
from the opposite side.
BODY { margin: 2em } /* all margins set to 2em */
BODY { margin: 1em 2em } /* top & bottom = 1em, right & left = 2em */
BODY { margin: 1em 2em 3em } /* top=1em, right=2em, bottom=3em, left=2em */
The last rule of the example above is equivalent to the example
below:
BODY {
margin-top: 1em;
margin-right: 2em;
margin-bottom: 3em;
margin-left: 2em; /* copied from opposite side (right) */
}
Negative margin values are allowed, but there may be
implementation-specific limits.
_____________________________________________
Related sites:
-
dotNet Slackers - Your latest resource for ASP.NET
-
Dotnet Spider - Outsourcing and Offshore software development in India
-
XML - Xselerator, XSL Editor, BizTalk Utilities, XML Tutorials, Learn XML
-
Planet Source Code - The largest public source code database on the Internet
|
|
|