The CSS margin property is used to control the spacing around an HTML element. It defines the amount of space between the element's border and adjacent elements or the container it's within. Define Margin To define any margin on any HTML element you can use the CSS margin property. This property is a shorthand property of the ' margin -top', ' margin -right', ' margin -bottom', and ' margin -left' properties. A single value will generate a margin all around the element. Syntax margin : "value"; The margin CSS shorthand property sets the margin area on all four sides of an element. The margin CSS property is a shorthand for setting the margin -bottom, margin -top, margin -left, margin -right CSS properties. See property values and examples.