CSS Reference ยท Multi-column and Fragmentation
The column-rule-style property
Reference for the CSS column-rule-style property: choose solid, dashed, dotted, double and other line styles between columns, with live examples.
The column-rule-style property sets the style of the line between the columns of a multi-column container. It accepts the same keywords as border-style and is one of the three longhands of column-rule.
The initial value is none, which is why a column rule never shows up until you choose a style. This is the property to set first when a rule you expected does not appear.
.article { column-count: 3; column-rule-style: dashed; }
Try it
Syntax
column-rule-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset;
- Initial value:
none - Applies to: multi-column containers
- Inherited: no
- Animatable: no (discrete)
- Computed value: as specified
Values
| Value | Description |
|---|---|
none |
No rule is drawn, and the width computes to 0. The default. |
hidden |
Behaves like none for column rules. |
solid |
A single continuous line. |
dashed |
A series of short dashes. |
dotted |
A series of round or square dots. |
double |
Two parallel lines; the rule needs some thickness to show both. |
groove, ridge |
A carved or raised 3D effect based on the color. |
inset, outset |
A sunken or raised 3D effect. |
Usage notes
- Pair it with a width. The width has a usable default (
medium), but the style does not, sosolidis usually the only declaration you must add. noneremoves the width too. When the style isnoneorhidden, the computed width is0.- Keep it simple.
solidanddottedare the most readable choices for text. The 3D styles look dated and their appearance varies between browsers. - Thin double lines collapse. A
doublerule at1pxor2pxlooks like a single line. Use at least3px. - Not animatable. You cannot transition between styles. To fade a rule in or out, animate
column-rule-colorinstead.
Browser support
Supported in all current major browsers, although the exact look of the 3D styles differs between them.
Related
column-ruleโ the shorthandcolumn-rule-widthโ line thicknesscolumn-rule-colorโ line colorborder-styleโ the same keywords for borders- Lesson: Multi-column Layout