The column-rule CSS property sets the width, style, and color of the rule (line) drawn between columns in a multi-column layout.
It is a shorthand property that sets the individual column-rule-* properties in a single, convenient declaration: column-rule-width, column-rule-style, and column-rule-color.
Note: As with all shorthand properties, any individual value that is not specified is set to its corresponding initial value (possibly overriding values previously set using non-shorthand properties).
column-rule: dotted; column-rule: solid 8px; column-rule: solid blue; column-rule: thick inset blue; /* Global values */ column-rule: inherit; column-rule: initial; column-rule: unset;
The column-rule property is specified as one, two, or three of the values listed below, in any order.
<'column-rule-width'><length> or one of the three keywords, thin, medium, or thick. See border-width for details.<'column-rule-style'>border-style for possible values and details.<'column-rule-color'><color> value.<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>
/* Same as "medium dotted currentColor" */
p.foo { column-rule: dotted; }
/* Same as "medium solid blue" */
p.bar { column-rule: solid blue; }
/* Same as "8px solid currentColor" */
p.baz { column-rule: solid 8px; }
p.abc { column-rule: thick inset blue; }
<p class="content-box"> This is a bunch of text split into three columns. Take note of how the `column-rule` property is used to adjust the style, width, and color of the rule that appears between the columns. </p>
.content-box {
padding: 0.3em;
background: #ff7;
column-count: 3;
column-rule: inset 2px #33f;
}
| Specification | Status | Comment |
|---|---|---|
| CSS Multi-column Layout Module The definition of 'column-rule' in that specification. | Working Draft | Initial definition. |
| Initial value | as each of the properties of the shorthand:
|
|---|---|
| Applies to | multicol elements |
| Inherited | no |
| Media | visual |
| Computed value | as each of the properties of the shorthand:
|
| Animation type | as each of the properties of the shorthand:
|
| Canonical order | per grammar |
| Desktop | ||||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
| Basic support | 50
|
12
|
52
|
10 | 11.1
|
3
|
| Mobile | |||||||
|---|---|---|---|---|---|---|---|
| Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
| Basic support | Yes | 50
|
? | 52
|
? | ? | 5.0
|
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule