The right property sets the horizontal inset of a positioned element toward or away from the physical right edge. It has no effect when position is static.
For absolute or fixed, it is the distance from the containing block’s right edge. For relative, a positive value moves the box to the left of its normal spot. The initial value is auto. It is not inherited. Prefer inset-inline-end when the offset should follow writing direction.
Baseline for lengths, percentages, and auto.
Not deprecated. Study those values first. Newer anchor() / anchor-size() forms for right have limited support — skip them until you need anchor positioning.
Same absolute pattern. Parent is relative; child is absolute.
Use a percentage.right: 50% is half the parent’s width from the right edge.
Not centered by itself. The box’s own width still sticks out past the midpoint unless you also translate it.
Scales with the parent. Wider containers move the inset farther in pixels.
Edge Cases & Pitfalls
If right seems ignored, one of these is usually why.
static
Needs a non-static position
right on a static element does nothing. Set position to relative, absolute, fixed, or sticky.
parent
Absolute needs a containing block
Without a positioned ancestor, absolute right is measured from a higher ancestor (often the initial containing block), which surprises beginners.
both
left and right together
Setting both can stretch the element. If width cannot satisfy both, left wins in left-to-right layouts; right wins in right-to-left.
relative
Relative right moves left
On a relatively positioned box, a positive right shifts the element toward the left of its normal position.
logical
Physical right does not flip in RTL
Use inset-inline-end when the end edge should follow writing direction.
Compatibility
Browser Support
right is a browser CSS property for positioned layout. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
right
Lengths, percentages, and auto are widely supported. anchor() values used with right are newer and not part of these numbers.
100%Common values
Google ChromeAll versions
Full support
Mozilla FirefoxAll versions
Full support
Apple SafariAll versions
Full support
Microsoft EdgeAll versions
Full support
OperaAll versions
Full support
Samsung InternetAll versions
Full support
Internet ExplorerAll versions
Full support
rightWidely supported
Bottom line: Safe for auto, px, em, rem, and percentages on positioned elements. Treat anchor() as progressive. It is not a runtime API.
Remember
Key Takeaways
Role: inset a positioned element from the physical right edge.
Prerequisite:position must not be static.
Relative quirk: positive right moves the box left of its normal spot.
Logical twin: use inset-inline-end when the end edge should follow writing mode.
One line: set a non-static position, then use right to measure from the physical right edge — absolute pins; relative nudges left.
Frequently Asked Questions
It sets the horizontal inset of a positioned element relative to the physical right edge. Absolute and fixed use the containing block; relative offsets from the normal position toward the left.
The initial value is auto. The browser then follows other rules such as left, width, and normal flow.
No. right has no effect on static elements. Use relative, absolute, fixed, or sticky.
Yes. Percentages refer to the width of the containing block.
right is always the physical right edge. inset-inline-end follows writing direction and can map to the left side in RTL.
It is Baseline and widely available for lengths, percentages, and auto. Newer anchor() values have limited support. It is a browser CSS property, not a Node.js feature.