在线文档教程
CSS
逻辑属性 | Logical Properties

直列大小 | inline-size

inline-size

这是一种实验技术

由于该技术的规格不稳定,请查看各种浏览器的兼容性表格以供使用。还要注意,随着规范的变化,实验技术的语法和行为在未来版本的浏览器中可能会发生变化。

inline-size属性定义一个元素的块的水平或垂直尺寸,这取决于它的写入模式。其对应于任一widthheight属性,这取决于的值writing-mode

/* <length> values */ inline-size: 300px; inline-size: 25em; /* <percentage> values */ inline-size: 75%; /* Keyword values */ inline-size: 25em border-box; inline-size: 75% content-box; inline-size: max-content; inline-size: min-content; inline-size: available; inline-size: fit-content; inline-size: auto; /* Global values */ inline-size: inherit; inline-size: initial; inline-size: unset;

如果写作模式是垂直定向的,则inline-size与元素的高度有关;否则,则与元素的宽度有关。相关财产是block-size,它定义元素的其他维度。

初始值auto
应用于same as width and height
是否继承no
百分比inline-size of containing block
适用媒体visual
计算值same as width and height
Animation typediscrete
规范顺序the unique non-ambiguous order defined by the formal grammar

句法

价值

inline-size属性取值为widthheight

形式语法

<'width'>

HTML

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

CSS

.exampleText { writing-mode: vertical-rl; background-color: yellow; inline-size: 110px; }

规格

SpecificationStatusComment
CSS Logical Properties Level 1The definition of 'inline-size' in that specification.Editor's DraftInitial definition

浏览器兼容性

FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic supportNo support41.0 (41.0)1No supportNo supportNo support

FeatureAndroidFirefox Mobile (Gecko)IE PhoneOpera MobileSafari Mobile
Basic supportNo support41.0 (41.0)1No supportNo supportNo support