CSS column-rule-width
Property
The column-rule-width
property in CSS sets the width (thickness) of the vertical rule (divider) between columns in a multi-column layout. It works together with column-rule-style
and column-rule-color
to define the column separator.
1. Syntax
Value | Description |
---|---|
thin | A thin column rule. |
medium (default) | A medium column rule. |
thick | A thick column rule. |
<length> | Custom thickness (e.g., 2px , 5px ). |
✅ Use column-rule
shorthand to set width, style, and color in one line.
2. Example – Setting Column Rule Width
✅ Adds a 3px solid black vertical rule between columns.
3. Example – Using column-rule
Shorthand
✅ Equivalent to:
4. Best Practices
✔ Always combine column-rule-width
with column-rule-style
for visibility.
✔ Use column-rule
shorthand for cleaner code.
✔ Keep column-rule-width
subtle to avoid cluttered layouts.