The inset-block property sets offsets along the block axis using logical CSS. It is the block-axis counterpart to physical top and bottom properties.
01
Block Axis
Logical offset.
02
auto
Default value.
03
Shorthand
Start & end.
04
Writing Mode
Adapts axis.
05
absolute
Common use.
06
inset
Related set.
Fundamentals
Introduction
The inset-block property in CSS is part of the Logical Properties and Values specification. It lets you control the block-start and block-end offsets of a positioned element in one declaration.
This is especially useful for layouts that must adapt to different writing modes, such as left-to-right, right-to-left, and vertical text directions.
Definition and Usage
Apply inset-block on positioned elements when you want to offset them along the block axis. In normal horizontal English pages, that usually means top and bottom offsets.
💡
Beginner Tip
Think of inset-block as logical top + bottom. Pair it with inset-inline for full logical positioning.
Foundation
📝 Syntax
The syntax for the inset-block property accepts one or two values:
Support zoom on mobile — Fixed block offsets should not clip important text.
Announce overlays properly — Use appropriate ARIA roles for modal and toast UI.
🧠 How inset-block Works
1
Writing mode defines the block axis
Horizontal or vertical text flow determines which physical direction block-start and block-end map to.
Writing mode
2
inset-block sets two offsets
One declaration controls both block-start and block-end distances for a positioned element.
CSS rule
3
The browser places the element
The box is offset from the containing block along the block axis.
Layout
=
↕
Logical block positioning
Layouts adapt cleanly when writing direction or mode changes.
Compatibility
🖥 Browser Compatibility
The inset-block 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-block as part of the CSS Logical Properties module.
94%Modern browser support
Google Chrome87+ · Desktop & Mobile
Full support
Mozilla Firefox63+ · Desktop & Mobile
Full support
Apple Safari14.1+ · macOS & iOS
Full support
Microsoft Edge87+ · Chromium
Full support
Opera73+ · Modern versions
Full support
inset-block property94% supported
Bottom line: Safe for modern logical layouts. Use physical top and bottom only when legacy support is required.
Wrap Up
🎉 Conclusion
The inset-block property is a versatile tool for managing block-axis positioning in a writing-mode-aware way. It simplifies logical layouts and pairs naturally with other logical inset and sizing properties.
For beginners, start with horizontal pages where it behaves like top and bottom, then explore vertical writing modes to see the real advantage of logical CSS.