CSS参考手册
逻辑属性 | Logical Properties
最大块大小 | max-block-size
这是一种实验技术
由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。还要注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。
max-block-size
CSS属性定义取决于其写入模式元素的块的水平或垂直最大尺寸。它相当于max-width
或max-height
属性,这取决于所定义的值writing-mode
。如果书写模式是垂直定向的,则其值max-block-size
与元素的最大宽度有关,否则与元素的最大高度有关。它涉及到max-inline-size
,它定义了元素的另一个维度。
/* <length> values */
max-block-size: 300px;
max-block-size: 25em;
/* <percentage> values */
max-block-size: 75%;
/* Keyword values */
max-block-size: none;
max-block-size: max-content;
max-block-size: min-content;
max-block-size: fit-content;
max-block-size: fill-available;
/* Global values */
max-block-size: inherit;
max-block-size: initial;
max-block-size: unset;
初始值 |
0 |
---|---|
应用于 |
same as width and height |
是否继承 |
no |
百分比 |
block-size of containing block |
适用媒体 |
visual |
计算值 |
same as max-width and max-height |
Animation type |
discrete |
规范顺序 |
the unique non-ambiguous order defined by the formal grammar |
句法
价值
max-block-size
属性的取值为max-width
和max-height
。
形式语法
<'max-width'>
例
HTML内容
<p class="exampleText">Example text</p>
CSS内容
.exampleText {
writing-mode: vertical-rl;
background-color: yellow;
block-size: 100%;
max-block-size: 200px;
}
规格
Specification |
Status |
Comment |
---|---|---|
CSS Logical Properties Level 1The definition of 'max-block-size' in that specification. |
Editor's Draft |
Initial definition |
浏览器兼容性
Feature |
Chrome |
Firefox (Gecko) |
Internet Explorer |
Opera |
Safari (WebKit) |
---|---|---|---|---|---|
Basic support |
No support |
41.0 (41.0)1 |
No support |
No support |
No support |
Feature |
Android |
Firefox Mobile (Gecko) |
IE Phone |
Opera Mobile |
Safari Mobile |
---|---|---|---|---|---|
Basic support |
No support |
41.0 (41.0)1 |
No support |
No support |
No support |
逻辑属性 | Logical Properties相关
层叠样式表( Cascading Style Sheets )是一种用来表现 HTML 或 XML 等文件样式的计算机语言。CSS 不仅可以静态地修饰网页,还可以配合各种脚本语言动态地对网页各元素进行格式化。