min-inline-size CSS property defines the horizontal or vertical minimal size of an element's block, depending on its writing mode. It corresponds to either the min-width min-height property, depending on the value of writing-mode .

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

句法

/* <length> values */
min-inline-size: 100px;
min-inline-size: 5em;
/* <percentage> values */
min-inline-size: 10%;
/* Keyword values */
min-inline-size: max-content;
min-inline-size: min-content;
min-inline-size: fit-content(20em);
/* Global values */
min-inline-size: inherit;
min-inline-size: initial;
min-inline-size: unset;
					

If the writing mode is vertically oriented, the value of min-inline-size relates to the minimum height of the element; otherwise, it relates to the minimum width of the element. A related property is min-block-size , which defines the other dimension of the element.

min-inline-size property takes the same values as the min-width and min-height 特性。

形式定义

初始值 0
适用于 如同 width and height
继承 no
百分比 inline-size of containing block
计算值 如同 min-width and min-height
动画类型 a length , percentage or calc();

形式句法

<'min-width'>
					

范例

Setting minimum inline size for vertical text

HTML

<p class="exampleText">Example text</p>
					

CSS

.exampleText {
  writing-mode: vertical-rl;
  background-color: yellow;
  block-size: 5%;
  min-inline-size: 200px;
}
					

结果

规范

规范 状态 注释
CSS Logical Properties and Values Level 1
The definition of 'min-inline-size' in that specification.
编者草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
min-inline-size Chrome 完整支持 57 Edge 完整支持 79 Firefox 完整支持 41
完整支持 41
不支持 38 — 51 Disabled
Disabled ). To change preferences in Firefox, visit
IE 不支持 No Opera 完整支持 44 Safari 完整支持 12.1 WebView Android 完整支持 57 Chrome Android 完整支持 57 Firefox Android 完整支持 41
完整支持 41
不支持 38 — 51 Disabled
Disabled ). To change preferences in Firefox, visit
Opera Android 完整支持 43 Safari iOS 完整支持 12.2 Samsung Internet Android 完整支持 7.0
fit-content Chrome 完整支持 57 Edge 完整支持 79 Firefox 完整支持 41 Prefixed
完整支持 41 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
IE 不支持 No Opera 完整支持 44 Safari 完整支持 12.1 WebView Android 完整支持 57 Chrome Android 完整支持 57 Firefox Android 完整支持 41 Prefixed
完整支持 41 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
Opera Android 完整支持 43 Safari iOS 完整支持 12.2 Samsung Internet Android 完整支持 7.0 Alternate Name
完整支持 7.0 Alternate Name
Alternate Name Uses the non-standard name: -webkit-fill-available
max-content Chrome 完整支持 57 Edge 完整支持 79 Firefox 完整支持 66
完整支持 66
完整支持 41 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
IE 不支持 No Opera 完整支持 44 Safari 完整支持 12.1 WebView Android 完整支持 57 Chrome Android 完整支持 57 Firefox Android 完整支持 66
完整支持 66
完整支持 41 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
Opera Android 完整支持 43 Safari iOS 完整支持 12.2 Samsung Internet Android 完整支持 7.0
min-content Chrome 完整支持 57 Edge 完整支持 79 Firefox 完整支持 66
完整支持 66
完整支持 41 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
IE 不支持 No Opera 完整支持 44 Safari 完整支持 12.1 WebView Android 完整支持 57 Chrome Android 完整支持 57 Firefox Android 完整支持 66
完整支持 66
完整支持 41 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
Opera Android 完整支持 43 Safari iOS 完整支持 12.2 Samsung Internet Android 完整支持 7.0

图例

完整支持

完整支持

不支持

不支持

用户必须明确启用此特征。

用户必须明确启用此特征。

使用非标名称。

使用非标名称。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改: