The margin-bottom property
The margin-bottom
property sets a margin
at the bottom of an element. The value of the
property is any
size units
or the key property auto
, which allows
the browser to independently calculate
the element margin.
Syntax
selector {
margin-bottom: value;
}
Example
Let's give the block the 50px
bottom margin:
<div id="parent">
<div id="elem"></div>
</div>
#parent {
border: 1px solid green;
display: inline-block;
}
#elem {
margin-bottom: 50px;
border: 1px solid red;
width: 100px;
height: 100px;
}
:
See also
-
the
margin-top
property
that sets a top margin -
the
margin-left
property
that sets a left margin -
the
margin-right
property
that sets a right margin -
the
margin
property
that is a shorthand for a margin -
the
padding
property
that sets a padding