π What Is column-rule-width?
The column-rule-width property defines thethickness of the vertical divider (called a column rule) that appears between columns in a CSS Multi-Column Layout. It works similarly to border-width but applies only between the columns inside the container.
Note
β Always combine with column-rule-style and optionally column-rule-color
β Accepts any CSS length (px, em, rem, etc.)
π¦ Syntax
column-rule-width syntax
column-rule-width: thin | medium | thick | <length>;| Value | Description |
|---|---|
| thin | Browser-defined thin width (usually 1px) |
| medium | Browser default thickness (often 3px) |
| thick | Browser-defined thick width (around 5px) |
| <length> | Custom width like 2px, 0.2rem, 4pt |
π 1. Basic Example β Solid Column Rule Width
Simple rule width
.content {
column-count: 3;
column-rule-style: solid;
column-rule-width: 4px;
column-rule-color: #555;
}Adds a 4px solid gray divider between all columns.
π 2. Using Keyword Widths
Keyword widths
.article {
column-count: 2;
column-rule-style: solid;
column-rule-width: thick; /* browser-defined */
}Ideal for bold and readable partitions.
π 3. Thin Dotted Rule
Thin dotted
.magazine {
column-count: 3;
column-rule-style: dotted;
column-rule-width: thin;
column-rule-color: #4a90e2;
}Useful for decorative or soft-line column dividers.
π 4. Using column-rule-width With column-gap
Gap + width
.layout {
column-count: 3;
column-gap: 50px;
column-rule-style: solid;
column-rule-width: 6px;
column-rule-color: #333;
}Wider gaps allow thicker rules without affecting readability.
π 5. Custom Width With Em/Rem Units
Relative units
.content {
column-count: 2;
column-rule-style: solid;
column-rule-width: 0.3rem;
column-rule-color: crimson;
}Relative units scale properly with responsive typography.
π 6. Using Shorthand column-rule
Shorthand
.content {
column-count: 3;
column-rule: 5px double #9b59b6;
}column-rule sets width + style + color in one declaration.
π§ͺ Real-World Examples
1οΈβ£ Magazine / Newspaper Layout
Newspaper columns
.news {
column-count: 3;
column-rule-style: solid;
column-rule-width: 2px;
column-rule-color: #ccc;
}2οΈβ£ Two-Column Blog Article
Blog style
.blog {
column-count: 2;
column-rule-style: dashed;
column-rule-width: 3px;
column-rule-color: #ff9800;
}3οΈβ£ Elegant Book Layout for Print
Print layout
@media print {
.chapter {
column-count: 2;
column-rule-style: solid;
column-rule-width: thin;
column-rule-color: black;
}
}β οΈ Common Mistakes
- β Only setting width β without style, rule wonβt show
- β Very thick rules combined with small gaps make text look cramped
- β Expecting the rule to appear on the container edges (it only appears between columns)
Note
π₯ Summary
The column-rule-width property controls how thick the dividing line between columns appears in a multi-column layout. Whether you're designing articles, magazines, blogs, or print layouts, adjusting the rule width enhances readability and adds aesthetic clarity.
Learn more βMDN Docs π