min-block-size
CSS
property defines the minimum horizontal or vertical 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
.
If the writing mode is vertically oriented, the value of
min-block-size
relates to the minimum width of the element; otherwise, it relates to the minimum height of the element. A related property is
min-inline-size
, which defines the other dimension of the element.
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-block-size: 100px; min-block-size: 5em; /* <percentage> values */ min-block-size: 10%; /* Keyword values */ min-block-size: max-content; min-block-size: min-content; min-block-size: fit-content(20em); /* Global values */ min-block-size: inherit; min-block-size: initial; min-block-size: unset;
min-block-size
property takes the same values as the
min-width
and
min-height
特性。
| 初始值 |
0
|
|---|---|
| 适用于 |
same as
width
and
height
|
| 继承 | no |
| 百分比 | block-size of containing block |
| 计算值 |
same as
min-width
and
min-height
|
| 动画类型 | a length , percentage or calc(); |
<'min-width'>
<p class="exampleText">Example text</p>
.exampleText {
writing-mode: vertical-rl;
background-color: yellow;
min-block-size: 200px;
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
CSS Logical Properties and Values Level 1
The definition of 'min-block-size' in that specification. |
编者草案 | 初始定义 |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
min-block-size
|
Chrome 完整支持 57 | Edge 完整支持 79 |
Firefox
完整支持
41
|
IE 不支持 No | Opera 完整支持 44 | Safari 完整支持 12.1 | WebView Android 完整支持 57 | Chrome Android 完整支持 57 |
Firefox Android
完整支持
41
|
Opera Android 完整支持 43 | Safari iOS 完整支持 12.2 | Samsung Internet Android 完整支持 7.0 |
fit-content
|
Chrome 完整支持 57 | Edge 完整支持 79 | Firefox 不支持 No | IE 不支持 No | Opera 完整支持 44 | Safari 完整支持 12.1 | WebView Android 完整支持 57 | Chrome Android 完整支持 57 | Firefox Android 不支持 No | Opera Android 完整支持 43 | Safari iOS 完整支持 12.2 |
Samsung Internet Android
完整支持
7.0
Alternate Name
|
max-content
|
Chrome 完整支持 57 | Edge 完整支持 79 |
Firefox
完整支持
66
|
IE 不支持 No | Opera 完整支持 44 | Safari 完整支持 12.1 | WebView Android 完整支持 57 | Chrome Android 完整支持 57 |
Firefox Android
完整支持
66
|
Opera Android 完整支持 43 | Safari iOS 完整支持 12.2 | Samsung Internet Android 完整支持 7.0 |
min-content
|
Chrome 完整支持 57 | Edge 完整支持 79 |
Firefox
完整支持
66
|
IE 不支持 No | Opera 完整支持 44 | Safari 完整支持 12.1 | WebView Android 完整支持 57 | Chrome Android 完整支持 57 |
Firefox Android
完整支持
66
|
Opera Android 完整支持 43 | Safari iOS 完整支持 12.2 | Samsung Internet Android 完整支持 7.0 |
完整支持
不支持
用户必须明确启用此特征。
使用非标名称。
要求使用供应商前缀或不同名称。
min-width
and
min-height
writing-mode
block-size
border-block
border-block-color
border-block-end
border-block-end-color
border-block-end-style
border-block-end-width
border-block-start
border-block-start-color
border-block-start-style
border-block-start-width
border-block-style
border-block-width
border-end-end-radius
border-end-start-radius
border-inline
border-inline-color
border-inline-end
border-inline-end-color
border-inline-end-style
border-inline-end-width
border-inline-start
border-inline-start-color
border-inline-start-style
border-inline-start-width
border-inline-style
border-inline-width
border-start-end-radius
border-start-start-radius
inline-size
inset
inset-block
inset-block-end
inset-block-start
inset-inline
inset-inline-end
inset-inline-start
margin-block
margin-block-end
margin-block-start
margin-inline
margin-inline-end
margin-inline-start
max-block-size
max-inline-size
min-block-size
min-inline-size
padding-block
padding-block-end
padding-block-start
padding-inline
padding-inline-end
padding-inline-start