HTML & CSS Wiki
Advertisement

The margin-bottom property is used in CSS and certain HTML elements. It sets the margin space required on the bottom of an element. A negative value is also allowed. The margin property is the shorthand property for setting the margin for all sides, or individual sides, of an element. Other properties for setting the other margins are margin-top, margin-left, and margin-right.


Values[]

Value Description
<length> Specifies a fixed width. Examples of lengths are: pt, px, em, etc.
<percentage> A <percentage> is always relative to the width of the containing block.
auto See the auto value for margin.


HTML example:

<h1 style="margin-bottom:5px;">
1st heading content.
</h1>


CSS example:

h1 {
    margin-bottom:5px;
}

See Also[]

Advertisement