CSS inset-inline-end Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The inset-inline-end property sets the logical inline-end offset of a positioned element. In horizontal left-to-right text, that usually means the same edge as right.

With direction: rtl, the same value maps to the left edge. With writing-mode: vertical-rl, it can map to a different physical side (often bottom). It has no effect on static elements. Pair it with inset-inline-start, or set both via inset-inline.

Baseline · Widely available.

Not deprecated and not experimental. Logical inset properties have been widely available across browsers since April 2021. Internet Explorer does not support them.

CSS Syntax

syntax.css
inset-inline-end: <length> | <percentage> | auto | initial | inherit;

The initial value is auto. The property is not inherited. Percentages refer to the containing block’s size on the inline axis.

Property Values

ValueDescriptionTry it
<length>Fixed distance from the inline-end edgeTry it
<percentage>Percent of the containing block’s inline sizeTry it
With writing-modePhysical edge changes when writing mode is verticalTry it
Needs positionWithout a positioned value, the property does nothingTry it
initialResets to autoTry it
inheritUses the parent’s inset-inline-end valueTry it

How to Use inset-inline-end

Position the element, then offset it from the inline-end edge.

  1. Create a containing block if needed (position: relative on the parent).
  2. Set the child to position: absolute (or another non-static value).
  3. Add inset-inline-end with a length or percentage.
  4. Optionally change direction or writing-mode to see which physical edge moves.
PieceRequired?Role
position ≠ staticYesWithout it, inset-inline-end is ignored
Length or %Yes (to see an offset)Distance from the logical inline-end edge
direction / writing-modeOptionalChooses which physical edge is inline-end
Start sideSeparateUse inset-inline-start or the inset-inline shorthand

Live Preview

The blue box is position: absolute. Change only inset-inline-end. In horizontal LTR text this acts like right.

Larger values pull the box farther from the inline-end edge (leftward in LTR text).

Box

inset-inline-end: 20px

CSS Examples

Each snippet focuses on inset-inline-end. Position is required so the offset applies. Use Try It Yourself for a live editor.

Example 1 — Offset with a Length

In horizontal LTR text, 20px acts like right: 20px.

CSS
<style>
  .stage { position: relative; height: 140px; border: 1px dashed #94a3b8; }
  .box {
    position: absolute;
    top: 16px;
    width: 120px;
    inset-inline-end: 20px;
    background: #2563eb;
    color: #fff;
    padding: 8px;
  }
</style>

<div class="stage">
  <div class="box">end: 20px</div>
</div>
Try It Yourself

How It Works

  1. Position the child. absolute inside a relative stage.
  2. Set the end offset. inset-inline-end: 20px distances the box from inline-end.
  3. Map in LTR horizontal mode. Inline-end is the right edge here.
  4. Leave start alone. Without a start inset, width comes from content (or an explicit width).

Example 2 — Percentage Offset

Percentages are relative to the containing block’s inline size.

CSS
<style>
  .stage { position: relative; height: 140px; border: 1px dashed #94a3b8; }
  .box {
    position: absolute;
    top: 16px;
    width: 120px;
    inset-inline-end: 20%;
    background: #2563eb;
    color: #fff;
    padding: 8px;
  }
</style>

<div class="stage">
  <div class="box">end: 20%</div>
</div>
Try It Yourself

How It Works

  1. Keep absolute positioning. Same stage pattern as before.
  2. Use a percentage. 20% is of the stage’s inline size (width here).
  3. Scale with the container. Wider stages increase the gap from the end edge.
  4. Still logical. The percentage tracks the inline axis, not a fixed physical side forever.

Example 3 — Vertical Writing Mode

With vertical-rl, inline-end is no longer the right edge.

CSS
<style>
  .stage {
    position: relative;
    height: 160px;
    border: 1px dashed #94a3b8;
    writing-mode: vertical-rl;
  }
  .box {
    position: absolute;
    inset-block-start: 12px;
    inset-inline-end: 20px;
    background: #2563eb;
    color: #fff;
    padding: 8px;
  }
</style>

<div class="stage">
  <div class="box">Follows inline-end</div>
</div>
Try It Yourself

How It Works

  1. Switch writing mode. vertical-rl rotates the inline axis.
  2. Keep the logical property. inset-inline-end still means “from the end of the inline axis.”
  3. Physical edge changes. The offset no longer sits on the right like right would.
  4. Why logical helps. One rule stays correct across writing modes and RTL.

Edge Cases & Pitfalls

If the offset looks wrong, check these first.

position

Static elements ignore inset-inline-end

Set position to relative, absolute, fixed, or sticky first.

right

Not always the same as right

right is physical. Prefer inset-inline-end when the end edge must follow writing mode or RTL.

shorthand

inset-inline can overwrite it

A later inset-inline declaration sets both start and end. Put the longhand after the shorthand if you need only the end side.

mode

Direction and writing mode change the edge

Do not assume “always right.” Check direction and writing-mode.

auto

auto means no forced end offset

With auto, placement comes from other rules (such as a set start offset plus width, or static position).

Browser Support

inset-inline-end is a browser CSS property for logical positioned offsets. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

inset-inline-end

Chrome 87+, Edge 87+, Firefox 63+, Safari 14.1+. Internet Explorer has no support — fall back to right (or the matching physical side in RTL/vertical modes).

96% Modern browser support
Google Chrome 87+
Full support
Mozilla Firefox 63+
Full support
Apple Safari 14.1+
Full support
Microsoft Edge 87+
Full support
Opera 73+
Full support
Samsung Internet 14+
Full support
Internet Explorer No support
Not supported
inset-inline-end Widely supported

Bottom line: Safe for modern sites. For Internet Explorer, use right (or the physical edge that matches your direction/writing mode). It is not a runtime API.

Key Takeaways

  • Role: offset a positioned box from the logical inline-end edge.
  • Needs position: relative, absolute, fixed, or sticky.
  • Often like right: in horizontal LTR, then adapts with direction and writing mode.
  • Initial value: auto. Not inherited.

One line: positioned box + inset-inline-end: 20px; = logical end offset that follows writing mode and direction.

Frequently Asked Questions

It sets the logical inline-end offset of a positioned element. In horizontal LTR writing mode that usually matches right.
The initial value is auto. The browser then places the inline-end edge from other positioning rules.
right always targets the physical right edge. inset-inline-end follows writing-mode and direction, so in RTL it can map to the left edge instead.
No. It only affects elements with position set to relative, absolute, fixed, or sticky.
inset-inline is the shorthand that sets both inset-inline-start and inset-inline-end. Use inset-inline-end when you only need the end side.
It is Baseline Widely available. Chrome 87+, Edge 87+, Firefox 63+, and Safari 14.1+ support it. Internet Explorer does not. It is a browser CSS property, not a Node.js feature.

Next: inset-inline-start

Set the logical inline-start offset on a positioned element.

inset-inline-start tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful