CSS max-block-size Property
Example
p {
background-color: #1A73E8;
max-block-size: 150px;
}
writing-mode:
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Meaning:
The max-block-size CSS property specifies the maximum size of an element in the direction opposite that of the writing direction as specified by writing-mode.
That is, if the writing direction is horizontal, then max-block-size is equivalent to max-height; if the writing direction is vertical, max-block-size is the same as max-width.
Note: The other dimension's maximum length is specified using the max-inline-size property.
This is useful because the max-width is always used for horizontal sizes and max-height is always used for vertical sizes, and if you need to set lengths based on the size of your text content, you need to be able to do so with the writing direction in mind.
Default value: | none |
Inherited: | No |
Animatable: | Yes |
Version: | CSS3 |
JavaScript syntax: |
|
Standard Syntax
max-block-size: none|length|percentage|max-content|min-content|fit-content(length|percentage)|initial|inherit|revert|revert-layer|unset;
Browser Support
Status
Property Values
The following table describes the values of this property:
Value | Description |
---|---|
none | No limit on the size of the box. |
length | Defines the max-block-size as an absolute value. |
percentage | Defines the max-block-size as a percentage of the containing block's size in block axis. |
max-content | The intrinsic preferred max-block-size. |
min-content | The intrinsic minimum max-block-size. |
fit-content(length|percentage) | Uses the fit-content formula with the available space replaced by the specified argument, i.e. min(max-content, max(min-content, argument)). |
initial | Sets this property to its default value. |
inherit | If specified, the associated element takes the computed value of its parent element animation-delay property. |
revert | Reverts the cascaded value of the property from its current value to the value the property |
revert-layer | Rollback styles to the ones specified in previous cascade layers. |
unset | Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not. |
Default CSS Property Values
selectors {
max-block-size: none;
}