CSS inset-inline-end Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Layout & Positioning

What You’ll Learn

The inset-inline-end property controls the offset of an element’s inline-end edge using logical CSS. In horizontal LTR pages, that usually means the right edge.

01

Inline-End

Logical edge.

02

auto

Default value.

03

Longhand

One side only.

04

RTL

Adapts direction.

05

absolute

Common use.

06

inset-inline

Shorthand pair.

Introduction

The inset-inline-end property in CSS is a logical property that defines the offset of an element’s inline-end edge within its containing block. Logical properties are writing-mode and direction-aware, so they adapt to LTR, RTL, and other layout contexts.

It is part of the CSS Logical Properties and Values specification, which helps you build layouts that work across languages and text directions without rewriting positioning rules.

Definition and Usage

Apply inset-inline-end on positioned elements when you need to offset or anchor the inline-end side only. Use it for badges, side panels, close buttons, or any UI pinned to the logical end of the inline axis.

💡
Beginner Tip

Think of inset-inline-end as logical right in horizontal LTR writing mode. Pair it with inset-inline-start or use the inset-inline shorthand when you need both inline edges.

📝 Syntax

The syntax for the inset-inline-end property accepts a single value:

syntax.css
element {

  inset-inline-end: value;

}

Basic Example

inset-inline-end-basic.css
.badge {

  position: absolute;

  inset-inline-end: 20px;

  inset-block-start: 1rem;

}
inset-inline-end: auto; inset-inline-end: 20px; inset-inline-end: 1rem; inset-inline-end: 0;

Default Value

The default value of the inset-inline-end property is auto, which means the browser determines the inline-end offset from other positioning rules.

Syntax Rules

  • Longhand for the inline-end side of the inset-inline shorthand.
  • Only works when position is not static.
  • The property is not inherited.
  • Accepts length, percentage, and auto values.
  • In horizontal LTR writing mode, maps to right.

⚡ Quick Reference

QuestionAnswer
Initial valueauto
Applies toPositioned elements
InheritedNo
AnimatableYes, as a length
Horizontal LTR writing modeBehaves like right

💎 Property Values

ValueDescription
lengthA fixed offset such as 20px, 1em, or 1rem.
percentageAn offset relative to the containing block size on the inline axis.
autoLets the browser calculate the inline-end offset automatically.

Inline-End and Text Direction

Logical inset properties follow the document’s direction instead of fixed physical sides:

  • Horizontal LTR (dir="ltr") — inline-end is usually the physical right edge.
  • Horizontal RTL (dir="rtl") — inline-end moves to the opposite side, but the same CSS rule still works.
  • Related longhandsinset-inline-start controls the opposite inline edge; inset-inline sets both in one rule.
🔄
When to Use the Longhand

Use inset-inline-end alone when only the inline-end edge needs a fixed offset. Use inset-inline when both inline-start and inline-end should be set together.

👀 Live Preview

An absolutely positioned box with inset-inline-end: 20px in horizontal LTR writing mode:

Examples Gallery

Offset from the inline-end edge, anchor a side panel, stretch with inline-start, and see behavior in RTL direction.

🔢 Inline-End Offsets

Start with a fixed inline-end offset and anchor UI to the logical end of the container.

Example 1 — 20px Inline-End Offset

Place a badge 20px from the inline-end edge of a positioned container.

inset-inline-end-offset.css
.badge {

  position: absolute;

  inset-inline-end: 20px;

  inset-block-start: 1rem;

}
Try It Yourself

How It Works

In horizontal LTR writing mode, the badge sits 20px from the right edge of its containing block.

Example 2 — Anchor to Inline-End

Pin a side panel flush to the inline-end edge with inset-inline-end: 0.

inset-inline-end-zero.css
.side-panel {

  position: absolute;

  inset-inline-end: 0;

  inset-block: 0;

  inline-size: 3.5rem;

}
Try It Yourself

How It Works

inset-inline-end: 0 anchors the element to the inline-end edge, which is a common pattern for side rails and drawer panels.

📈 Stretch & RTL

Combine inline-start and inline-end offsets, then test logical behavior in right-to-left direction.

Example 3 — With inset-inline-start

Set both inline edges to stretch a bar along the inline axis.

inset-inline-end-stretch.css
.bar {

  position: absolute;

  inset-inline-start: 1rem;

  inset-inline-end: 1rem;

  inset-block-start: 1.5rem;

  block-size: 2.5rem;

}
Try It Yourself

How It Works

When both inline edges are set, the element stretches between them. This is equivalent to inset-inline: 1rem.

Example 4 — RTL Direction

See how inset-inline-end still controls the inline-end edge when text direction is right-to-left.

inset-inline-end-rtl.css
html {

  direction: rtl;

}



.box {

  position: absolute;

  inset-inline-end: 16px;

}
Try It Yourself

How It Works

Logical properties follow the inline axis, not fixed right directions, so the same rule works in both LTR and RTL layouts.

♿ Accessibility

  • Positioning does not change reading order — DOM order still matters for screen readers.
  • Test RTL layouts — Logical offsets should not hide essential content.
  • Avoid covering focusable controls — Side panels and overlays can block keyboard access.
  • Support zoom on mobile — Fixed inline-end offsets should not clip important text.
  • Set dir on the document — Correct text direction helps both layout and assistive technology.

🧠 How inset-inline-end Works

1

Direction defines inline-end

LTR or RTL text flow determines which physical direction inline-end maps to.

Text direction
2

inset-inline-end sets one offset

You specify the distance from the containing block’s inline-end edge to the element’s inline-end edge.

CSS rule
3

The browser places the element

The box is positioned along the inline axis while other inset values remain at their defaults.

Layout
=

Logical inline-end positioning

Badges, panels, and controls stay on the correct logical edge when text direction changes.

🖥 Browser Compatibility

The inset-inline-end property is supported in modern browsers including Chrome 87+, Firefox 63+, Safari 14.1+, and Edge 87+.

Baseline · Modern browsers

Logical positioning in today’s browsers

All major browsers support inset-inline-end as part of the CSS Logical Properties module.

94% Modern browser support
Google Chrome 87+ · Desktop & Mobile
Full support
Mozilla Firefox 63+ · Desktop & Mobile
Full support
Apple Safari 14.1+ · macOS & iOS
Full support
Microsoft Edge 87+ · Chromium
Full support
Opera 73+ · Modern versions
Full support
inset-inline-end property 94% supported

Bottom line: Safe for modern logical layouts. Use physical right only when legacy support is required.

🎉 Conclusion

The inset-inline-end property is a useful tool for web developers who want layouts that adapt to different writing modes and text directions. By using logical properties, you can anchor UI to the inline-end edge in a way that stays correct when direction changes.

For beginners, start with horizontal LTR pages where it behaves like right, then explore RTL direction to see the real advantage of logical CSS.

💡 Best Practices

✅ Do

  • Use for badges, side panels, and close buttons pinned to inline-end
  • Pair with inset-inline-start when stretching along the inline axis
  • Test in RTL and vertical writing modes
  • Set a non-static position value first
  • Prefer logical properties in internationalized layouts

❌ Don’t

  • Apply without positioning context
  • Mix logical and physical offsets without reason
  • Assume it works like margin or padding
  • Hide critical content with absolute overlays
  • Forget containing block setup for absolute children

Key Takeaways

Knowledge Unlocked

Five things to remember about inset-inline-end

Use these points when anchoring elements to the logical inline-end edge.

5
Core concepts
auto 02

Default auto

Browser pick.

Default
1 val 03

Longhand

One side.

Syntax
RTL 04

Direction

Adapts axis.

Pattern
inline 05

inset-inline

Shorthand.

Family

❓ Frequently Asked Questions

inset-inline-end sets the offset of an element's inline-end edge along the inline axis, relative to its containing block.
The default is auto, which lets the browser determine inline-end placement from other positioning rules.
In horizontal LTR writing mode they often match, but inset-inline-end follows the logical inline axis and adapts when text direction changes.
No. Like inset and inset-inline, it only affects elements with position set to relative, absolute, fixed, or sticky.
No. inset-inline-end is not inherited.

Practice in the Live Editor

Open the HTML editor, set inset-inline-end on positioned elements, and compare LTR versus RTL direction.

HTML Editor →

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.

5 people found this page helpful