Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. CSS:层叠样式表
  3. CSS 参考
  4. 属性
  5. column-rule-width

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

column-rule-width

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2017年3月.

column-rule-widthCSS 属性设置多列布局中列之间绘制的线条的宽度。

尝试一下

column-rule-width: thin;
column-rule-width: medium;
column-rule-width: thick;
column-rule-width: 12px;
<section>  <p>    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;}

语法

css
/* 关键字值 */column-rule-width: thin;column-rule-width: medium;column-rule-width: thick;/* <length> 值 */column-rule-width: 1px;column-rule-width: 2.5em;/* 全局值 */column-rule-width: inherit;column-rule-width: initial;column-rule-width: revert;column-rule-width: revert-layer;column-rule-width: unset;

column-rule-width 属性被指定为单个<'border-width'> 值。

<'border-width'>

是由border-width 定义的关键字,定义列规则的宽度。它可以是<length>thinmedium、或thick 关键字之一。

形式定义

初始值medium
适用元素multicol elements
是否是继承属性
计算值绝对长度;如果column-rule-style 设为nonehidden,则为0
动画类型alength

形式语法

column-rule-width =
<line-width-list>|
<auto-line-width-list>

<line-width-list> =
<line-width-or-repeat>#

<auto-line-width-list> =
<line-width-or-repeat>#? ,<auto-repeat-line-width> ,<line-width-or-repeat>#?

<line-width-or-repeat> =
<line-width>|
<repeat-line-width>

<auto-repeat-line-width> =
repeat(auto ,[<line-width>]#)

<line-width> =
<length [0,∞]>|
thin|
medium|
thick

<repeat-line-width> =
repeat([<integer [1,∞]>] ,[<line-width>]#)

<integer> =
<number-token>

示例

设置属性宽度为 4px 的列规则

HTML

html
<p>  这是分成三列的文本。在 `column-rule-width`  属性中用于更改列与列之间的线条宽度。修改列之间线条的宽度。你不觉得这很棒吗?</p>

CSS

css
p {  column-count: 3;  column-rule-style: solid;  column-rule-width: 4px;}

结果

规范

Specification
CSS Multi-column Layout Module Level 1
# crw

浏览器兼容性

参见

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp