If three values are declared, it is margin: [top] [left-and-right] [bottom];. Any of the individual margins can be declared using longhand, in which case you would define only one value per property: .box { margin-top: 20px; margin-right: 10px; margin-bottom: 20px; margin-left: 10px; }
1: the link you are using is the MDN page which is a good reference but not the official specification. The margin-block-start CSS property defines the logical block start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation.
Start with the free Agency Accelerator today. The margin property defines the outermost portion of the box model, creating space around an element, outside of any defined borders. Margins are set using lengths, percentages, or the keyword auto and can have negative values.
The CSS margin-block and margin-inline properties are very similar to CSS properties margin-top, margin-bottom, margin-left and margin-right, but the margin-block and margin-inline properties are dependent on block and inline directions. Note: The related CSS property writing-mode defines block direction.
The margin-bottom CSS property sets the margin area on the bottom of an element. A positive value places it farther from its neighbors, while a negative value places it closer. See full list on developer.mozilla.org
This property has no effect on non-replaced inline elements, such as or . See full list on developer.mozilla.org
Values t The size of the margin as a fixed value. t The size of the margin as a percentage, relative to the inline size (width in a horizontal language, defined by writing-mode) of the containing block. autot The browser selects a suitable value to use. See margin. See full list on developer.mozilla.org
Setting positive and negative bottom margins See full list on developer.mozilla.org
BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data. See full list on developer.mozilla.org
•margin-top, margin-right, and margin-left and the margin shorthand •The mapped logical properties: margin-block-start, margin-block-end, margin-inline-start, and margin-inline-end and the shorthands margin-block and margin-inline See full list on developer.mozilla.org