W3cubDocs

/CSS

column-rule

The column-rule shorthand CSS property sets the width, style, and color of the line drawn between columns in a multi-column layout.

Try it

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).

Syntax

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: revert;
column-rule: revert-layer;
column-rule: unset;

Values

The column-rule property is specified as one, two, or three of the values listed below, in any order.

<'column-rule-width'>

Is a <length> or one of the three keywords, thin, medium, or thick. See border-width for details.

<'column-rule-style'>

See border-style for possible values and details.

<'column-rule-color'>

Is a <color> value.

Formal definition

Initial value as each of the properties of the shorthand:
Applies to multicol elements
Inherited no
Computed value as each of the properties of the shorthand:
Animation type as each of the properties of the shorthand:

Formal syntax

column-rule = 
<'column-rule-width'> ||
<'column-rule-style'> ||
<'column-rule-color'>

Examples

Example 1

/* 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;
}

Example 2

HTML

<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>

CSS

.content-box {
  padding: 0.3em;
  background: #ff7;
  column-count: 3;
  column-rule: inset 2px #33f;
}

Result

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
column-rule 501 1212 52
3.5–74Before Firefox 3, the default value for the normal keyword was 0 and not 1em.
10 1511.1 93 50≤37 5018 524 1411.1 91 5.01.0

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/column-rule