Margins
Learn how margins work in CSS.
We'll cover the following...
Box model properties
The values held by the margin, padding, and border properties directly affect the size of an element’s box.
We’ll see how these properties relate to the box model, beginning with the margin property.
The margin property
The margin property defines the outer portion of the box model. It creates space around an element outside ofany borders. In other words, it’s an invisible space around the box that pushes other elements away from it.
We can specify our element’s margins on each side, like so:
... Ask