CSS max-block-size Property
Description
The max-block-size property sets an upper limit on the size of a box in the block dimension — that is, along the axis that flows in the block direction for the element’s writing mode. Because it is a logical property, its effect follows the document’s writing-mode and direction: in horizontal-tb writing modes it behaves like the conventional vertical constraint on height, while in vertical writing modes it constrains the horizontal measurement that corresponds to the block axis. Conceptually it serves the same role on the logical block axis as max-height does on a physical vertical axis, but without assuming a particular physical orientation.
In layout calculations, max-block-size acts as a clamping constraint applied during the used-size resolution phase. When an element’s intrinsic size, specified size, or content-driven size would result in a block-axis extent larger than the value of this property, that extent is reduced to the maximum allowed value. It therefore interacts closely with other logical sizing properties such as min-block-size and block-size, and it participates in the same precedence rules: the final used size is determined by resolving specified values, intrinsic contributions, and then applying min/max clamps.
How that clamp affects rendering depends on the layout model in use. In flow layout the property limits the box’s extent and can cause overflow of its contents if they require more space; overflow handling is then governed by overflow. In flex and grid layouts, max-block-size can influence how flex items shrink or how grid tracks distribute space, because it constrains the size that an item or track may take along the block axis. For replaced elements and elements with intrinsic aspect ratios, the property participates in intrinsic sizing calculations and can be a decisive factor when resolving which dimension should be derived from the other.
Practically, max-block-size is useful for responsive and component-based design where you want elements to grow with their content up to a controlled limit, regardless of writing direction. It is also a tool to guard against runaway content growth (for example long lists or media) without having to use physical properties that break in different writing modes; its logical nature makes it a more robust way to express cross-writing-mode constraints, much like the complementary max-inline-size does for the inline axis.
Definition
- Initial value
- none
- Applies to
- same as width and height
- Inherited
- no
- Computed value
- same as max-width and max-height
- Animatable
- a length, percentage or calc();
- JavaScript syntax
- object.style.maxBlockSize
Interactive Demo
This will limit the size in the block dimension, potentially causing an overflow.
Syntax
max-block-size: none | <max-width>
Values
- noneNo limit on the size of the box.
- <max-width>Defines the max-block-size as an value or percentage.
Example
Browser Support
The following information will show you the current browser support for the CSS max-block-size 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
