margin-left
Sets the amount of empty space on the left side of an element. This can be used to push the element away from its neighbor on the left.
It is documented as part of the CSS Anchor Positioning, CSS Box Model specification.
Syntax
/* Usage Example */
.pushed-right {
/* Pushes the element to the right by adding space to its left */
margin-left: 2rem;
}
/* Syntax */
margin-left: auto;
margin-left: anchor-size;
/* Global values */
margin-left: inherit;
margin-left: initial;
margin-left: revert;
margin-left: revert-layer;
margin-left: unset;
margin-left Browser support
Widely available
Since
2015 96% global usage
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.
1+
1+
1+
12+