Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the differences and relations among Margin, Border and Padding attributes?

Shulou Source: shulou.com Published: 2022-06-03 17:55:18 10月02日 Update

This article mainly introduces the Margin, Border, Padding attributes of what differences and connections, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor with you to understand.

The relation and difference among Margin attribute, Border attribute and Padding attribute

The meaning of three elements:

Margin attribute

Retrieves or sets the extension margin of the four sides of the object. If all four parameter values are provided, they will act on all four sides in the order of top, right, bottom, and left. If only one is provided, it will be used on all four sides. If two are provided, * is for top and bottom, and the second is for left and right. If three are provided, * is for the top, the second is for the left and right, and the third is for the bottom. To use this property for an inline object, you must first set the object's height or width property, or set the position property to absolute.

Border attribute

The border of the content; the default value of border-color will be the text color. To use this property, you must first set the object's height or width property, or set the position property to absolute.

Padding attribute

Retrieves or sets the patch margins on the four sides of the object. If all four parameter values are provided, they will act on all four sides in the order of top, right, bottom, and left. If only one is provided, it will be used for all four sides. If two are provided, * is for top and bottom, and the second is for left and right. If three are provided, * is for the top, the second is for the left and right, and the third is for the bottom. To use this property for an inline object, you must first set the object's height or width property, or set the position property to absolute. Negative values are not allowed.

Thank you for reading this article carefully. I hope the article "what are the differences and connections between Margin, Border and Padding attributes" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Attributes objects three four articles links two functions parameters order Retrieval value elements interests content at the same time meaning text more Friends Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Redmi Apple MySQL vpn