How to set the margin property of CSS? Margin is an outer margin. This time to teach you how to use the margin property to manipulate the Div. How to manipulate the spacing between div and div
Margin is used to set the distance between object labels, such as 2 upper and lower div boxes, and we can use the margin style to achieve up to 2 box spacing. Margin rendering is located on the outside of the object border, close to the border, marign and padding position, but the CSS padding is close to the border on the inside of the border.
The DIV CSS margin refers to the CSS property word margin,margin is the epitaxial margin that sets the object's edges, with no background color or color.
1. Margin syntax
margin:10px
The value of margin is a digital +html unit and can also be auto (auto, adaptive)
2. Application Structure
div{margin:10px}
Set the Div object to a distance of 10px
3. Margin description
Margin is the distance of the outer margin of the Set object.
The value of margin has three cases, which can be positive integers and negative integers plus units such as px pixels (margin-left:20px), auto attributes (Margin-left:auto Auto), and a percentage (%) value (margin-left:3%).
Margin extension (single-sided spacing attribute word)
Margin-left the left epitaxial margin of the object (margin-left:5px; Left epitaxial distance 5px)
Margin-right object to the right of the epitaxial margin (margin-right:5px; Right epitaxial distance 5px)
Margin-top the upper epitaxial margin of the object (margin-top:5px; Upper extension distance 5px)
Margin-bottom the bottom epitaxial margin of the object (margin-bottom:5px; 5px below epitaxial distance)
Related reading:
What are the different ways to set the background color of a div
Div+css How to use
what is CSS