column-rule-color CSS property sets the color of the line drawn between columns in a multi-column layout.

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.

句法

/* <color> values */
column-rule-color: red;
column-rule-color: rgb(192, 56, 78);
column-rule-color: transparent;
column-rule-color: hsla(0, 100%, 50%, 0.6);
/* Global values */
column-rule-color: inherit;
column-rule-color: initial;
column-rule-color: unset;
					

column-rule-color property is specified as a single <color> 值。

<color>

The color of the rule that separates columns.

形式定义

初始值 currentcolor
适用于 multicol elements
继承 no
计算值 computed color
动画类型 a color

形式句法

<color>

where
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>

where
<rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )
<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )
<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )
<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )

where
<alpha-value> = <number> | <percentage>
<hue> = <number> | <angle>

范例

Setting a blue column rule

HTML

<p>This is a bunch of text split into three columns.
   The `column-rule-color` property is used to change
   the color of the line that is drawn between columns.
   Don't you think that's wonderful?</p>
					

CSS

p {
  column-count: 3;
  column-rule-style: solid;
  column-rule-color: blue;
}
					

结果

规范

规范 状态 注释
CSS Multi-column Layout Module
The definition of 'column-rule-color' in that specification.
工作草案 初始定义。

浏览器兼容性

The compatibility table in 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 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
column-rule-color Chrome 完整支持 50 Edge 完整支持 12 Firefox 完整支持 52
完整支持 52
不支持 3.5 — 74 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
IE 完整支持 10 Opera 完整支持 11.1 Safari 完整支持 9 WebView Android 完整支持 50 Chrome Android 完整支持 50 Firefox Android 完整支持 52
完整支持 52
完整支持 4 Prefixed
Prefixed Implemented with the vendor prefix: -moz-
Opera Android 完整支持 11.1 Safari iOS 完整支持 9 Samsung Internet Android 完整支持 5.0

图例

完整支持

完整支持

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

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

另请参阅

元数据

  • 最后修改: