CSS inset-inline Property
Description
The inset-inline property defines offsets along the inline axis of a box — that is, how far the element is placed from the inline-start and inline-end edges of its containing block. It is used to position an element in the inline direction when the element participates in CSS positioning; for example, when the element’s position makes it subject to offset calculations. Because it targets the inline axis rather than a fixed physical edge, it moves elements relative to the flow direction rather than always toward the left or right side.
Being a logical property, inset-inline adapts to writing mode and direction. In a horizontal left-to-right writing mode the inline-start/end map to the physical left/right edges, while in a right-to-left mode they swap; in vertical writing modes the inline axis becomes vertical, so the same property controls top/bottom movement in that context. This makes it the logical counterpart to legacy physical properties such as left and right, and it pairs with the block-axis sibling inset-block to fully define an element’s positioned offsets. There is also a shorthand that combines inline and block offsets when needed: inset.
In practical layout work, inset-inline is useful for creating direction-agnostic positioning rules: it simplifies responsive and internationalized layouts by avoiding separate rules for LTR and RTL content. Designers use it to nudge absolutely or relatively positioned elements along the inline axis, to align overlays or callouts with inline anchors, or to implement adaptive spacing that follows the document’s writing orientation. Because it participates in the normal offset model, it interacts with other layout behaviors (stacking, overflow, hit testing) the same way other positional offsets do, so it’s a helpful tool for keeping position logic consistent across different languages and writing modes.
Definition
- Initial value
- See individual properties
- Applies to
- positioned elements
- Inherited
- no
- Computed value
- See individual properties
- Animatable
- See individual properties
- JavaScript syntax
- object.style.insetInline
Interactive Demo
Syntax
inset-inline: <top>{1,2}
Values
- <top>{1,2} The first value represents the start edge style, and the second value represents the end edge style. If only one value is given, it applies to both the start and end edges.
Example
Browser Support
The following information will show you the current browser support for the CSS inset-inline property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
