CSS min-block-size Property
Example
Set the minimum size of a <div> element to 200 pixels in the block direction:
min-block-size: 200px;
}
More "Try it Yourself" examples below.
Definition and Usage
The min-block-size property specifies the minimum size of an element in the block direction.
If the content is smaller than the minimum size in block direction, the min-block-size property value will be applied.
If the content is larger than the minimum size in block direction, the min-block-size property value has no effect.
Note: The related CSS property writing-mode defines block direction, and this affects the result of the min-block-size property. For pages in English, block direction is downward and inline direction is left to right.
The CSS
min-block-size property is very similar to CSS properties
min-height and
min-width , but the
min-block-size property is dependent on block direction.
| Default value: | auto |
|---|---|
| Inherited: | no |
| Animatable: | yes. Read about animatable Try it |
| Version: | CSS3 |
| JavaScript syntax: | object.style.minBlockSize="10px" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
| Property | |||||
|---|---|---|---|---|---|
| min-block-size | 57.0 | 79.0 | 41.0 | 12.1 | 44.0 |
CSS Syntax
Property Values
| Value | Description | Demo |
|---|---|---|
| auto | Default. The element's default min-block-size value. | Demo ❯ |
| length | Specifies min-block-size in px, pt, cm, etc. Read about length units | Demo ❯ |
| % | Specifies min-block-size in percent relative to size of parent element on the corresponding axis. | Demo ❯ |
| initial | Sets this property to its default value. Read about initial | |
| inherit | Inherits this property from its parent element. Read about inherit |
More Examples
Writing mode
With the writing-mode property value of a <div> element set to vertical-rl, the block direction is changed from downwards to sideways, and this affects how the min-block-size property work:
min-block-size: 200px;
writing-mode: vertical-rl;
}
Min-block-size vs Block-size
See how one <div> element with block-size 100px, and another <div> with min-block-size 100px, react differently with changing content size:
min-block-size: 100px;
}
#div2 {
block-size: 100px;
}
Related Pages
CSS block-size property: CSS Block-size property
CSS max-block-size property: CSS Max-block-size property
CSS min-height property: CSS Min-height property
CSS min-width property: CSS Min-width property
CSS writing-mode property: CSS Writing-mode property