CSS · Properties — CSS Anchor Positioning

margin-right

The CSS margin-right property. Initial value: 0. Not inherited.

Syntax
margin-right: <length-percentage> | auto | <anchor-size()>

Example

Try it

Notes

Media: visual. Applies to: allElementsExceptTableDisplayTypes. Computed value: percentageAsSpecifiedOrAbsoluteLength.

More in this group

anchor-name anchor-scope bottom left margin-bottom margin-left margin-top position-anchor

Learn this in the course

Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.

Open the course