大网数据广告活动
Web 标准与前端开发

column-rule-color

· 52CE 我爱测

**`column-rule-color`** CSS 属性设置在多列布局中列与列之间绘制的线的颜色。

column-rule-color CSS 属性设置在多列布局中列与列之间绘制的线的颜色。

CSS Demo: column-rule-color

column-rule-color: red;
column-rule-color: rgb(48, 125, 222);
column-rule-color: hsla(120, 80%, 40%, 0.6);
column-rule-color: currentcolor;
<section id="default-example">
  <p id="example-element">
    London. Michaelmas term lately over, and the Lord Chancellor sitting in
    Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
    as if the waters had but newly retired from the face of the earth, and it
    would not be wonderful to meet a Megalosaurus, forty feet long or so,
    waddling like an elephantine lizard up Holborn Hill.
  </p>
</section>
#example-element {
  columns: 3;
  column-rule: solid;
  text-align: left;
}

语法

/* <color> 值 */
column-rule-color: red;
column-rule-color: rgb(192 56 78);
column-rule-color: transparent;
column-rule-color: hsl(0 100% 50% / 60%);

/* 全局值 */
column-rule-color: inherit;
column-rule-color: initial;
column-rule-color: revert;
column-rule-color: revert-layer;
column-rule-color: unset;

column-rule-color 属性指定为单个 <color> 值。

取值

  • <color>
    • : 用于单独设置列之间分割线的颜色。

形式定义

形式语法

示例

设置列分割线为蓝色

HTML

<p>
  这是分成三列的文本。用
  <code>column-rule-color</code>
  属性更改了列与列之间的线条颜色。你不觉得这很棒吗?
</p>

CSS

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

结果

设置列分割线为蓝色

规范

浏览器兼容性

参见

  • 颜色 <color> 数据类型
  • 其他颜色相关属性:color、background-color、border-color、outline-color、text-decoration-color、text-emphasis-color、text-shadow 和 caret-color
  • 使用 CSS 为 HTML 元素应用颜色

来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
MDN Web Docs / Mozilla 贡献者
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 2.5

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。