CSS margin-bottomProperty


Example

Set the bottom margin of a p element

p
{
margin-bottom:2cm;
}

Try it Yourself »

Property definition and usage instructions

The margin-bottom property sets the bottom margin of an element.

Note:Negative values are allowed.

Default value: 0
Inherited: no
version: CSS1
JavaScript Syntax: object.style.marginBottom="10px"


Browser Support

The numbers in the table indicate the first browser version that supports the property.

Property
margin-bottom 1.0 6.0 1.0 1.0 3.5

Property value

Value Description
auto The browser calculates the bottom margin.
length Specifies the bottom margin in specific units, such as pixels, centimeters, etc. The default value is 0px.
% Specifies the bottom margin as a percentage based on the width of the parent element.
inherit Specifies that the bottom margin should be inherited from the parent element.


Related Articles

CSS Tutorial:CSS Margin

other extensions