Column-rule - CSS Property
Summary of characteristics of the column-rule property
Per grammar: serialization in the order of syntax. Values can be entered in any order.Syntax diagram of column-rule.
In the diagram, the bold terms are the predefined words of CSS, the other terms are described below:
column-ruleis a shorthand property that combinescolumn-rule-width,column-rule-style, andcolumn-rule-color. On diagram, these terms correspond to the syntaxes of the corresponding properties. Refer to their respective pages.- The syntax can be repeated several times with a comma as a separator.
Description of the column-rule property.
column-rule} defines the divider between columns, in the case of a multi-column layout, and, since it is described in the CSS Gap Decorations module,
for a flex container, a grid container, or any other container that displays columns. Although this last possibility is currently only supported by
or .
column-rule is a shorthand property that brings together several pieces of information:
↓
column-rule.
Here is the effect of column-rule in the case of a grid container or a flex container.
⚠ This will only work on or on .
column-ruleon a grid container.
column-ruleon a flex-box container.
You can check out the page on rule for a summary of everything about nets.
Values for column-rule.
- column-rule: 5px dashed red;
column-ruleaccepts values for the thickness, style, and color of column divider lines, in a grid container, flex-box, multi-column, or any other container that supports multiple columns.If a value is not specified, it is set to the default value. Warning! The default value of
column-rule-styleisnone. This means that a value for the style is required, otherwise the line will not be visible.ABCDEFGHIJKLMNOPQRSTUVWXYZcolumn-rule:5px dashed red; - column-rule: 5px dotted red, solid blue; column-rule: repeat(2,5px double red), solid;
It is possible to repeat several sets of values by separating them with a comma. The function
repeat()is supported. In the example below, there are two successive red lines, 5 pixels double, followed by a solid line in black with medium thickness. This pattern continues until the end of the borders.ABCDEFGHIJKLMNOPQRSTUVWXYZcolumn-rule:repeat(2,5px double red),solid; - column-rule: initial; column-rule: inherit; column-rule: revert; column-rule: revert-layer; column-rule: revert-rule; column-rule: unset;column-rule-width: initial; (
medium) column-rule-width: inherit; column-rule-width: revert; column-rule-width: revert-layer; column-rule-width: revert-rule; column-rule-width: unset;column-rule-style: initial; (none) column-rule-style: inherit; column-rule-style: revert; column-rule-style: revert-layer; column-rule-style: revert-rule; column-rule-style: unset;column-rule-color: initial; (currentcolor) column-rule-color: inherit; column-rule-color: revert; column-rule-color: revert-layer; column-rule-color: revert-rule; column-rule-color: unset;Common values are presented on these pages:
initial,inherit,revert,revert-layer,revert-rule,unset.
Examples with the column-rule property.
medium for the stroke width and currentColor for the color. Indeed, like all the summarized properties,
column-rule initializes all the relevant values, setting the unspecified parameters to their default.
column-gap).
The aesthetics of the result are probably questionable, but this example clearly shows that the width of the divider line is not added to the width of the
gutter.On the other hand, you can see that the divider line encroaches on the text of the columns, but it still stays behind it. So there’s no risk of the divider line hiding the column content.
Animation of the column-rule property.
Refer to the pages on long-hand properties for examples of animation.
Simulator.
You can see here the effect of column-rule on a multi-column container and a grid container. This would also work with a flex-box container.
⚠Of course, this simulator only works on browsers that fully recognize the column-rule property.
Browsers compatibility with column-rule.
Multi-column layouts are fairly well supported by recent browsers, even though there are still some inconsistencies. The following columns of the table (2 to 5) only concern the use of properties on a multi-column container. As for grid or flex-box containers, compatibility is lower: only and handle the properties correctly.
column-rule, which defines the parameters for the column separation lines in a column layout.column-rule-width, defining the thickness of the column separator line, in the case of a multi-column layout.column-rule-style in the case of a multi-column layout.column-rule-color property to set the color of column separator lines in a grid, flex-box, etc.Notes:
(1) Does not support the values avoid (in the column context), avoid-column, and avoid-page for the properties break-after, break-before, and break-inside.
layout
column-ruleproperty
column-rule-widthproperty
column-rule-styleproperty
column-rule-colorproperty
Browsers on computers :
Mobile browsers :
Outdated or marginal browsers :

Internet Explorer

UC Browser pour Androïd

Opéra Mobile

QQ Browser

Baidu Browser

Safari

Safari sur IOS

Opéra

Chrome

Edge

Firefox

Chrome pour Androïd

Samsung Internet

Androïd Brower

Firefox pour Androïd

KaiOS Browser

Opéra mini
Historic of the column-rule property.
-
CSS Gap Decorations Module Level 1.
This module covers the rules that define gutters between columns in a multi-column container (grid, flex-box...). It extends these possibilities to gutters between elements arranged in multiple rows, allowing these features to be used on other types of containers. Several properties define how these gutters should be drawn.
Regardingcolumn-ruleTransfer of thecolumn-ruleproperty description into this module.April 17, 2025Working Draft. -
CSS Multi-column Layout Module Level 1
This specification describes multi-column layout. It is enough to set the number of columns on the container, and the content will be arranged across the specified number of columns. Of course, other properties allow finer control over multi-column containers.
This specification also defines properties concerning the space between columns and any possible dividing line.Regardingcolumn-ruleFirst description of multi-column layouts.
And introduction of related properties, including the shorthand propertycolumn-rule.June 23, 1999Working Draft.December 17, 2009Candidate Recommendation.
See also, about column layouts.
Multi-column layouts are described in the specification CSS Multi-column Layout Module. The property column-rule is explained in this module.
You will also find the reference for the terms below:
Properties:




