CSS Margin

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.

Terry White

Terry White is a professional Drupal & WordPress developer, Web developer, Web designer, Software Engineer, and Blogger. He strives for pixel-perfect design, clean robust code, and a user-friendly interface. If you have a project in mind and like his work, feel free to contact him

View all posts by Terry White →