Easy Tutorial
❮ Dom Obj Track Prop Style Alignitems ❯

Style marginBottom Property


Definition and Usage

The marginBottom property sets or returns the bottom margin of an element.

Syntax

Setting the marginBottom property:

Returning the marginBottom property:

Value Description
% Defines a percentage bottom margin based on the width of the parent element.
length Defines the width of the bottom margin using units like px, cm, etc.
auto The browser sets the bottom margin.
inherit The bottom margin is inherited from the parent element.

Browser Support

All major browsers support the marginBottom property.

Note: IE7 and earlier versions do not support the "inherit" value. IE8 requires a !DOCTYPE to support "inherit". IE9 supports "inherit".


Tips and Notes

Both the margin and padding properties insert space around an element. However, the difference is that margin inserts space outside the border, while padding inserts space inside the border.


Example

Change the bottom margin of a div element:

❮ Dom Obj Track Prop Style Alignitems ❯