您的位置:寻梦网首页编程乐园CSS 初步Cascading Style Sheets Index
Style Sheets
MARGIN PROPERTY:
 MARGIN-BOTTOM
 MARGIN-LEFT
 MARGIN-RIGHT
 MARGIN-TOP
 MARGIN


MARGIN-BOTTOM : LENGTH | PERCENTAGE | AUTO }

Inherited: No

The MARGIN-BOTTOM property allows you to set the dimensions for the bottom margin.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total height being defined as 100%.

AUTO

The AUTO value directs the browser to automatically calculate the bottom margin. By declaring AUTO, you can ensure that any previous declaration will not effect the bottom margin.

Code:
Selector {MARGIN-BOTTOM:  25MM}
Selector {MARGIN-BOTTOM:  1.0IN}
Selector {MARGIN-BOTTOM:  15PC}
Selector {MARGIN-BOTTOM:  36PT}
Selector {MARGIN-BOTTOM:  11.5%}
Selector {MARGIN-BOTTOM:  AUTO}


MARGIN-LEFT : LENGTH | PERCENTAGE | AUTO }

Inherited: No

The MARGIN-LEFT property allows you to set the dimensions for the left margin.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total width being defined as 100%.

AUTO

The AUTO value directs the browser to automatically calculate the left margin. By declaring AUTO, you can ensure that any previous declaration will not effect the left margin.

Code:
Selector {MARGIN-LEFT:  25MM}
Selector {MARGIN-LEFT:  1.0IN}
Selector {MARGIN-LEFT:  15PC}
Selector {MARGIN-LEFT:  36PT}
Selector {MARGIN-LEFT:  11.5%}
Selector {MARGIN-LEFT:  AUTO}


MARGIN-RIGHT : LENGTH | PERCENTAGE | AUTO }

Inherited: No

The MARGIN-RIGHT property allows you to set the dimensions for the right margin.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total width being defined as 100%.

AUTO

The AUTO value directs the browser to automatically calculate the right margin. By declaring AUTO, you can ensure that any previous declaration will not effect the right margin.

Code:
Selector {MARGIN-RIGHT:  25MM}
Selector {MARGIN-RIGHT:  1.0IN}
Selector {MARGIN-RIGHT:  15PC}
Selector {MARGIN-RIGHT:  36PT}
Selector {MARGIN-RIGHT:  11.5%}
Selector {MARGIN-RIGHT:  AUTO}


MARGIN-TOP : LENGTH | PERCENTAGE | AUTO }

Inherited: No

The MARGIN-TOP property allows you to set the dimensions for the top margin.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total height being defined as 100%.

AUTO

The AUTO value directs the browser to automatically calculate the top margin. By declaring AUTO, you can ensure that any previous declaration will not effect the top margin.

Code:
Selector {MARGIN-TOP:  25MM}
Selector {MARGIN-TOP:  1.0IN}
Selector {MARGIN-TOP:  15PC}
Selector {MARGIN-TOP:  36PT}
Selector {MARGIN-TOP:  11.5%}
Selector {MARGIN-TOP:  AUTO}


MARGIN : LENGTH | PERCENTAGE | AUTO }

Inherited: No

The MARGIN property allows you to set the same margin dimensions (values) for all four margins, left, right, top, and bottom in only one declaration.

You can declare one, two, three or four values:

If you declare one value, the size for all four margins will be that value.

If you declare two values, the top and bottom margins will be set by the first value, the right and left margins by the second.

If you declare three values, the top margin will be set by the first value, the right margin by the second, and the bottom and left margins by the third.

If you declare four values, the order is top, right, bottom, left.

LENGTH

The LENGTH value can be in any of the following seven units. Use the abbreviation.

LengthAbbrev.
centimetersCM
emsEM
inchesIN
millimetersMM
picasPC
pixelsPX
pointsPT

PERCENTAGE

The PERCENTAGE value is based upon the total width being defined as 100%.

AUTO

The AUTO value directs the browser to automatically calculate all four margins. By declaring AUTO, you can ensure that any previous declaration will not effect the margins.

Code:
Selector {MARGIN:  25MM}
Selector {MARGIN:  1.0IN}
Selector {MARGIN:  15PC 25PC}
Selector {MARGIN:  36PT 24PT 36PT}
Selector {MARGIN:  11.5%}
Selector {MARGIN:  10%  10%  10%  10%}
Selector {MARGIN:  AUTO}

Copyright 2000 by Infinite Software Solutions, Inc.
Trademark Information