Connecting Tech Pros Worldwide Help | Site Map

Margin Properties

By Mark Hardy
Administrator, TheScripts.com

Margin Parameters

margin-top
Allows you to set the spacing at the top of an element. You can have negative values (e.g. - 2px), however, please be careful using this one, because if you specify a high negative value (or rather really low) you can cause the visitors browser to crash.

P {margin-top: 15px;}

margin-right
Allows you to set the spacing to the right of an element. You can have negative values (e.g. - 2px), however, please be careful using this one, because if you specify a high negative value (or rather really low) you can cause the visitors browser to crash.

P {margin-right: 15px;}

margin-bottom
Allows you to set the spacing at the bottom of an element. You can have negative values (e.g. - 2px), however, please be careful using this one, because if you specify a high negative value (or rather really low) you can cause the visitors browser to crash.

P {margin-bottom: 20px;}

margin-left
Allows you to set the spacing to the left of an element. You can have negative values (e.g. - 2px), however, please be careful using this one, because if you specify a high negative value (or rather really low) you can cause the visitors browser to crash.

P {margin-left: 15px;}

margin
Allows you to set the general spacing that will be used on all sides of an element. You can have negative values (-2px), however, please be careful using this one, because if you specify a high negative value (or rather really low) you can cause the visitors browser to crash.

P {margin: 10px;}

« Border Properties Padding Properties »