๐ What Is column-rule-style?
The column-rule-style property defines theline style used for the vertical divider (column rule) between columns in a CSS Multi-Column Layout. It works similarly to border-style, but is applied only between columns โ not around the container.
Note
โ Controls the visual type of the rule
โ Requires column-rule-width and/or column-rule-color to be visible
๐ฆ Syntax
column-rule-style syntax
column-rule-style:
none | hidden | solid | dotted | dashed | double | groove | ridge | inset | outset;๐ Available Column Rule Styles
| Style | Description |
|---|---|
| none | No rule is drawn. |
| solid | Single solid line. |
| dotted | Dot pattern line. |
| dashed | Dash pattern line. |
| double | Two parallel lines. |
| groove | 3D-style carved effect. |
| ridge | 3D-style raised effect. |
| inset | Embossed inner effect. |
| outset | Embossed outer effect. |
๐ 1. Basic Solid Column Rule
Solid rule
.content {
column-count: 2;
column-rule-width: 2px;
column-rule-style: solid;
column-rule-color: #333;
}Creates a clean, simple divider line between columns.
๐ 2. Dotted Line Between Columns
Dotted
.article {
column-count: 3;
column-rule-style: dotted;
column-rule-width: 3px;
column-rule-color: #4a90e2;
}Perfect for decorative or soft-themed layouts.
๐ 3. Dashed Column Divider
Dashed
.post {
column-count: 2;
column-rule-style: dashed;
column-rule-width: 3px;
column-rule-color: #e74c3c;
}A dashed rule adds a modern, stylized feel.
๐ 4. Double Line โ Magazine Style
Double
.magazine {
column-count: 3;
column-rule-style: double;
column-rule-width: 4px;
column-rule-color: #666;
}Great for printed, elegant layouts like newspapers or reports.
๐ 5. Using 3D Styles (groove, ridge, inset, outset)
3D effects
.modern {
column-count: 2;
column-rule-width: 6px;
column-rule-style: groove;
column-rule-color: #888;
}3D rule styles provide depth for fancy editorial designs.
๐ 6. Using Shorthand column-rule
Shorthand version
.content {
column-count: 3;
column-rule: 5px solid #9b59b6;
}Shorthand combines width, style, and color in a single declaration.
๐งช Real-World Examples
1๏ธโฃ Editorial Article
Editorial layout
.editorial {
column-count: 3;
column-gap: 40px;
column-rule-style: solid;
column-rule-width: 2px;
column-rule-color: #bbb;
}2๏ธโฃ Blog Layout
Blog columns
.blog {
column-count: 2;
column-rule: 3px dashed #ff9800;
}3๏ธโฃ Multi-Column Legal Document
Legal doc
.legal {
column-count: 3;
column-rule: 1px dotted #555;
}โ ๏ธ Common Mistakes
- โ Setting column-rule-style without width โ rule may not appear
- โ Using thick dotted/dashed rules with tiny gaps โ readability issues
- โ Expecting rule outside edges (it only appears between columns)
Note
๐ฅ Summary
The column-rule-style property controls the **visual style** of the divider between columns in a multi-column layout. You can choose from solid, dotted, dashed, double, or decorative 3D styles to achieve the perfect look for your design.
Learn more โMDN Docs ๐