CSS max-inline-size property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
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
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.
- Try it
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.
- Try it
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.
- Try it
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.
- Try it
max-inline-size: 30%; auto
-
auto value means the inline-size will be changed automatically according to the content.
- Try it
max-inline-size: auto;
Applicable to
It applies to all elements