The block-size property sets the size of an element along the block axis. In a horizontal writing mode it behaves like height. In a vertical writing mode it behaves like width.
It is not inherited. The initial value is auto. Pair it with inline-size for the other axis, and with writing-mode when text direction changes.
Logical property.
Standard-track and Baseline Widely available. Prefer block-size over height when a layout must stay correct for both horizontal and vertical writing modes. fit-content() is experimental here; stretch has limited support.
Set vertical writing.writing-mode: vertical-rl rotates the axes.
Block becomes horizontal. Lines stack sideways; the block axis is now left–right.
block-size follows.150px controls physical width, not height.
Why logical wins. One rule keeps sizing correct when writing mode changes.
Edge Cases & Pitfalls
Most confusion comes from mixing logical and physical sizing.
map
Not always the same as height
In vertical writing modes, block-size maps to width. Do not assume it always means top–bottom size.
conflict
Mixing with height can conflict
Setting both height and block-size on the same element can produce unexpected results. Prefer one system.
percent
Percentage needs a sized containing block
Percentages resolve against the containing block’s block size. If the parent’s block size is auto, the percent often computes to auto — the same trap as height: %.
limits
min- / max-block-size override
Those properties can stop a box from shrinking or growing past a limit, just like min-height / max-height.
box
box-sizing still applies
With border-box, padding and border count inside the size. With content-box, they add outside it.
Compatibility
Browser Support
block-size is a browser layout property. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available since 2020
block-size
Chrome 57+, Firefox 41+, Safari 12.1+, Edge 79+, Opera 44+, Samsung Internet 7+. Same value set as width/height; stretch and fit-content() remain limited or experimental.
96%Common values
Google Chrome57+
Full support
Mozilla Firefox41+
Full support
Apple Safari12.1+
Full support
Microsoft Edge79+
Full support
Opera44+
Full support
Samsung Internet7.0+
Full support
Internet ExplorerNo support
Not supported
block-sizeWidely supported
Bottom line: Safe for modern sites. Prefer logical sizing when writing-mode flexibility matters. Skip Internet Explorer. Treat fit-content() as experimental and stretch as limited.
Remember
Key Takeaways
Role: size the block axis — height in horizontal mode, width in vertical mode.
Common values:auto, lengths, and percentages (same as height).
Initial value:auto. Not inherited.
Tip: use with inline-size for fully logical box sizing.
One line:block-size is the logical version of height — it follows the writing mode’s block axis.
Frequently Asked Questions
It sets the size of an element along the block axis. In horizontal writing modes it maps to height; in vertical writing modes it maps to width.
The initial value is auto. The browser sizes the box from content and layout rules.
height always controls the vertical size. block-size follows writing-mode, so it adapts when text runs vertically.
Use it when you want logical sizing that stays correct across horizontal and vertical writing modes.
No. Percentages resolve against the block size of the containing block.
It is Baseline and widely available: Chrome 57+, Firefox 41+, Safari 12.1+, Edge 79+, Opera 44+. Internet Explorer does not support it. It is a browser layout property, not a Node.js feature.