CSS max-inline-size property
Description
CSS max-inline-size specifies the maximum inline-size of an element.
When the content overflows the inline-size, it adds a vertical scroll bar to the element.
It behaves like max-height for the horizontal-tb writing mode.
-
It behaves like max-width for the vertical-* writing-mode.
Change the direction of flow of text.
horizontal-tb vertical-lr vertical-rl
Syntax
min-inline-size : none | min-content | max-content | +ve length | +ve percentage | auto
Property values
noneDefault
-
No limit of inline-size is applied to an element.
max-inline-size: none;
min-content
-
min-content value specifies the largest minimum inline-size of some descendant item.
The inline-size of the current element will be equal to the descendant element that has smallest inline-size.
max-inline-size: min-content;
max-content
-
max-content value represents that the largest maximum inline-size of some descendant item.
The inline-size of the current element will be equal to the descendant element that has largest inline-size.
max-inline-size: max-content;
length
-
length value specifies the maximum inline-size of the element.
-
30px value means the inline-size of an element can't exceed 30px no matter how much content is inside this element.
max-inline-size: 30px;
percentage
-
percentage value means the inline-size of current box can not exceed the percentage value of the parent box.
30% value means the inline-size of element must not be greater than 30% inline-size of the parent element.
max-inline-size: 30%;
auto
-
auto value means the inline-size will be changed automatically according to the content.
max-inline-size: auto;
Applicable to
It applies to all elements
From web4college, the free CSS digger
#CSS digger
Was this article helpful?
This is the first child element.
This is the second child element.