The cover of The Complete Idiot's Guide to Create a Web Page The Complete Idiot's Style Sheets Reference

| Index | Current Category: Margins |
| Previous Style: list-style-type | Next Style: margin-bottom |


margin

A shorthand style that enables you to set multiple margin properties at once.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later
Notes:
  • In the style sheets box model, the margin is the space outside of the border. It separates the box from other boxes to the left and right, as well as above and below.
  • This style can apply the following margin properties, in this order: margin-top, margin-right, margin-bottom, and margin-left.
  • Separate each property with a space.
  • If you specify just a single value, it applies to all four margins.

See Also:

margin-bottom, margin-left, margin-right, margin-top

Possible Values:

[margin-bottom]
See margin-bottom.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later

[margin-left]
See margin-left.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later

[margin-right]
See margin-right.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later

[margin-top]
See margin-top.

Support:

W3C StandardInternet ExplorerNetscape Navigator
CSS1 and later 3.0 and later 4.0 and later

Example:
<BLOCKQUOTE>
You have to stay in shape. My grandmother, she started 
walking five miles a day when she was 60. She's 97 
today and we don't know where the hell she is.<BR>
&#151;Ellen DeGeneres
</BLOCKQUOTE>
<P>
<BLOCKQUOTE STYLE="margin: 50 200 100 200">
You have to stay in shape. My grandmother, she started 
walking five miles a day when she was 60. She's 97 
today and we don't know where the hell she is.<BR>
&#151;Ellen DeGeneres
</BLOCKQUOTE>
How It Looks:
You have to stay in shape. My grandmother, she started walking five miles a day when she was 60. She's 97 today and we don't know where the hell she is.
—Ellen DeGeneres

You have to stay in shape. My grandmother, she started walking five miles a day when she was 60. She's 97 today and we don't know where the hell she is.
—Ellen DeGeneres

| Index | Current Category: Margins |
| Previous Style: list-style-type | Next Style: margin-bottom |