What is the outer margin in css
Editor to share with you what the outer margin in css is, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
The css outer margin margin property has up to four values: the upper outer margin, the right outer margin, the lower outer margin, and the left outer margin, respectively. It can also be three: the upper outer margin, the left outer margin, and the lower outer margin. It can also be two: the upper and lower margin and the left and right margin. At least one: indicates the outer margin of the four sides.
The css outer margin attribute value can be auto, the browser automatically calculates the outer margin, and the block-level element is displayed horizontally; the attribute value can be a percentage, which is calculated based on the width of the parent element; and the attribute value can be a CSS length unit, and the value can be negative. The property value can be inherit.
Then let's look directly at the implementation code of the outer margin of css.
Note: the default value of the css outer margin margin property is 0, so if you do not declare a value for margin, the outer margin will not appear.
The css outer margin implementation code is as follows:
Php Chinese website
P {
Background-color:yellow
}
P.margin {
Margin:2cm4cm3cm4cm
}
No outer margin size specified
Have outer margin
The above is all the content of the article "what is the margin in css". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!