473,513 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ


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 »

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.