CSS property: margin
Availability
|
BlackBerry®
Device Software version 4.6 or later
|
Usage
|
All elements except those with table display types other than table-caption, table, and inline-table
|
Inherited
|
No
|
Default value
|
—
|
The margin property is a shorthand property used to specify the margin width around all sides of an element.
Property values
Parameter
|
Description
|
[ margin-top | margin-right | margin-bottom | margin-left ]
|
This value is a whitespace-separated list of values for the margin-top, margin-right, margin-bottom, and margin-left properties.
You can specify one to four values:
One value: All four sides will have the specified margin.
Two values: The first value is applied to the top and bottom margin; the second to the right and left.
Three values: The first value is applied the top margin; the second to the right and left; and the third to the bottom.
Four values: The first value is applied to the top margin; the second to the right; the third to the bottom; and the fourth to the left.
See the descriptions of the individual properties for more information about valid values.
|
inherit
|
This value specifies that the element inherits the margin property value from the containing element.
|
Index
Was this information helpful? Send us your comments.