Margins
suggest changeSyntax
- margin: <top right bottom left>; one value applies to all four sides
- margin: <top> <left and right> <bottom>; three values, and the missing left is copied from the right
- margin: <top and bottom> <left and right>
- margin: <top> <right> <bottom> <left>
- margin-top: <top>;
- margin-right: <right>;
- margin-bottom: <bottom>;
- margin-left: <left>;
Parameters
Parameter | Details |
————— | –––––––––– |
0 | set margin to none |
auto | Absorbs leftover space. A block with a definite width and both horizontal margins set to auto is centered. |
units (e.g. px) | see parameter section in Units for a list of valid units |
inherit | inherit margin value from parent element |
initial | restore to initial value |
Remarks
More on “Collapsing Margins”: here.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents