CSS

列间隙 | column-gap

column-gap

column-gapCSS属性设置为被指定将被显示为多列的元件的元件列之间的间隙的大小。

/* Keyword value */ column-gap: normal; /* <length> values */ column-gap: 3px; column-gap: 2.5em; /* Global values */ column-gap: inherit; column-gap: initial; column-gap: unset;

Initial valuenormal
应用对象multicol elements
是否可继承no
百分比值refer to the content width of the multi-column element
媒体visual
计算值as specified with lengths made absolute
动画类型a length, percentage or calc(
规范顺序per grammar

语法

关键词normal或长度。

normal是指示使用浏览器定义的列之间的默认间距的关键字。大多数现代浏览器遵循的规范建议这个长度等于1em。<length>是<length>定义列之间的差距的大小的值。它不能是负面的,但可能是相等的0。

形式语法

<length-percentage> | normalwhere <length-percentage> = <length> | <percentage>

实例

.content-box { border: 10px solid #000000; column-count: 3; column-gap: 20px; }

规范

SpecificationStatusComment
CSS Multi-column Layout ModuleThe definition of 'column-gap' in that specification.Candidate RecommendationInitial definition

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari (WebKit)
Basic support(Yes)-webkit 50.02(Yes)-webkit (Yes)1.5 (1.8)-moz1 52 (52)31011.103.0 (522)-webkit

FeatureAndroidAndroid WebviewEdgeFirefox Mobile (Gecko)IE PhoneOpera MobileSafari MobileChrome for Android
Basic support?? 50.02(Yes)-webkit (Yes)(Yes) 52.0 (52)3???? 50.02