The margin-*** property sets the top, bottom, left, and right margins of an element.
(*** = top, bottom, left, and right)
div {
margin-top: 5px;
margin-right: 10px;
margin-bottom: 15px;
margin-left: 20px;
}
Property |
Value |
Explanation |
margin-top |
length, %, or auto |
the top margin |
margin-right |
length, %, or auto |
the right margin |
margin-bottom |
length, %, or auto |
the bottom margin |
margin-left |
length, %, or auto |
the left margin |
Example