CSS Margins. The CSS margin properties are used to create space around elements, outside of any defined borders. With CSS,

The CSS margin properties are used to create space around elements, outside of any defined borders. With CSS, you have full control over the margins. There are properties for setting the margin for each side of an element (top, right, bottom, and left).

How do margins work in CSS?

The margin CSS property sets the margin area on all four sides of an element. It is a shorthand for margin-top , margin-right , margin-bottom , and margin-left .
As each of the properties of the shorthand:
  1. margin-bottom : 0.
  2. margin-left : 0.
  3. margin-right : 0.
  4. margin-top : 0.

What is Auto in CSS?

Auto is a CSS value that has a number of uses. It’s the default value for a lot of box-model properties like width , height , margin , and background-size . … There’s other more obscure places that auto can be used as well, like overflow , cursor , table-layout and the column-width property of CSS columns.