CSS inset-block Property
Description
The inset-block CSS property controls an element’s offset along the block axis of the current writing mode — in other words, how far it sits from the block-start and block-end edges of its containing box. Because it operates on the logical block dimension rather than physical top/bottom sides, it adapts automatically when the writing-mode or block flow changes (for example, when switching between horizontal and vertical text directions). This makes it a useful tool for building layouts that need to behave consistently across different writing modes without rewriting separate physical offsets.
When applied to positioned boxes, inset-block participates in the offset calculations that determine where the box is placed in the block direction. It is conceptually the block-axis counterpart to properties that address both axes; for example, it relates to the umbrella logical shorthand inset and pairs with its inline sibling inset-inline. Because it targets the logical axis rather than specific physical edges, using inset-block helps avoid conditional rules for different writing-modes and reduces duplication when designing internationalized or rotated layouts.
In practice, inset-block is commonly used in combination with element positioning and spacing rules to create predictable, direction-agnostic offsets. It interacts with positioning schemes (see position) and sits alongside box-model properties such as margin and padding when determining final placement and spacing relationships. By relying on logical offsets instead of hard-coded physical top/bottom values, authors can make components that retain their intended spatial relationships regardless of writing mode, text orientation, or locale-specific flow.
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.insetBlock
Interactive Demo
Syntax
inset-block: <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-block 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
