CSS column-rule Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Layout & Columns

What You’ll Learn

The column-rule property draws a line between columns in multi-column layouts — a shorthand for width, style, and color.

01

Column Line

Divider between cols.

02

Shorthand

Width style color.

03

none Default

No rule by default.

04

solid / dashed

Border-like styles.

05

column-gap

Space for the rule.

06

Readability

Visual separation.

Definition and Usage

The column-rule CSS property defines the appearance of the rule (line) between columns in a multi-column layout. It is a shorthand for setting the width, style, and color of the divider between columns.

It helps enhance visual separation between columns, making content easier to read and more aesthetically pleasing — similar to the lines between newspaper columns.

💡
Beginner Tip

Always set column-gap when using column-rule. The rule is drawn in the gap — without gap space, the line may not be visible.

📝 Syntax

The syntax for column-rule follows the same pattern as border:

syntax.css
selector {
  column-rule: width style color;
}

Basic Example

column-rule-solid.css
.columns {
  column-count: 3;
  column-gap: 20px;
  column-rule: 5px solid black;
}

Syntax Rules

  • The initial value is equivalent to medium none currentcolor (no visible rule).
  • Order: width, then style, then color — like the border shorthand.
  • Requires multi-column layout (column-count or column-width).
  • Drawn in the middle of the column-gap area.
  • Longhand properties: column-rule-width, column-rule-style, column-rule-color.

⚡ Quick Reference

QuestionAnswer
Initial valuemedium none currentcolor
Applies toMulti-column containers
InheritedNo
AnimatablePartially (color and width in some browsers)
Common useMagazine-style dividers between text columns

💎 Property Values

column-rule accepts three components — width, style, and color — combined in one shorthand declaration.

Width

Can be any length value or keyword:

  • Keywords: thin, medium, thick
  • Lengths: 1px, 5px, 0.2rem, etc.

Style

Determines the line style between columns:

  • none — no rule (default style component)
  • solid, dashed, dotted, double
  • groove, ridge, inset, outset

Color

Can be any valid CSS color value — named colors, hex, rgb, hsl, or currentColor.

ComponentExampleMeaning
Full shorthandcolumn-rule: 5px solid black;5px solid black line between columns
Defaultcolumn-rule: medium none currentcolor;No visible rule between columns
Dashedcolumn-rule: 1px dashed #94a3b8;Light dashed divider
none solid dashed dotted double

Longhand Properties

The column-rule shorthand expands into three individual properties:

  • column-rule-width — thickness of the line
  • column-rule-style — line style (solid, dashed, etc.)
  • column-rule-color — line color

Use longhand when you only need to change one part of the rule, such as color alone.

👀 Live Preview

Both blocks use three columns with gap. The left has no rule; the right uses column-rule: 2px solid #64748b.

No column-rule

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

2px solid rule

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Examples Gallery

Try a solid black rule, dashed dividers, dotted color rules, and a subtle thin line.

📐 Basic Column Rules

Start with the reference example — a three-column layout with a 5px solid black rule.

Example 1 — Three Columns with 5px Solid Black Rule

Create a three-column layout with a solid black rule between columns.

column-rule-solid.html
<style>
  .columns {
    column-count: 3;
    column-gap: 20px;
    column-rule: 5px solid black;
  }
</style>

<div class="columns">...</div>
Try It Yourself

How It Works

A 5px solid black line appears centered in the 20px gap between each column pair.

Example 2 — Dashed Column Rule

Use a dashed style for a lighter, less formal divider between columns.

column-rule-dashed.css
.dashed-columns {
  column-count: 2;
  column-gap: 2rem;
  column-rule: 2px dashed #94a3b8;
}
Try It Yourself

How It Works

The dashed style creates a broken line — softer than a solid rule for casual layouts.

🎨 Styled Column Rules

Experiment with dotted lines, brand colors, and thin dividers.

Example 3 — Dotted Rule with Brand Color

Combine a dotted style with a custom color for a decorative column divider.

column-rule-dotted.css
.brand-columns {
  column-count: 3;
  column-gap: 1.5rem;
  column-rule: 3px dotted #7c3aed;
}
Try It Yourself

How It Works

Style and color work together — dotted plus a purple hex value creates a branded divider.

Example 4 — Thin Subtle Column Rule

Use a 1px solid line in a light gray for a clean, minimal magazine layout.

column-rule-thin.css
.subtle {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid #e2e8f0;
  max-width: 42rem;
}
Try It Yourself

How It Works

A thin, light rule provides separation without drawing too much attention away from the content.

🧠 How column-rule Works

1

Columns and gap are set

Define columns with column-count and space with column-gap.

Prerequisite
2

You define the rule

Set width, style, and color with column-rule shorthand.

CSS rule
3

Browser draws lines in gaps

A vertical rule appears centered in each column gap, running the full height of the container.

Rendering
=

Clear column separation

Readers see distinct columns with visible dividers that improve scanability.

Modern Browser Support

The column-rule property is supported in most modern browsers, including Chrome, Firefox, Safari, Edge, and Opera.

Baseline · Modern browsers

Column rules in today’s browsers

All major browsers support column-rule as part of the Multi-column Layout module.

97% Modern browser support
Google Chrome 50+ · Desktop & Mobile
Full support
Mozilla Firefox 52+ · Desktop & Mobile
Full support
Apple Safari 9+ · macOS & iOS
Full support
Microsoft Edge 12+ · All versions
Full support
Opera 37+ · Modern versions
Full support
column-rule property 97% supported

Bottom line: Use column-rule for multi-column dividers. Pair with adequate column-gap so rules render clearly.

Conclusion

The column-rule property is a versatile tool for adding visual distinction between columns in a multi-column layout. By adjusting the width, style, and color of the column rule, you can enhance the readability and design of your content.

Experiment with solid, dashed, and dotted styles to see how they can improve the appearance of your multi-column layouts.

💡 Best Practices

✅ Do

  • Always set column-gap alongside column-rule
  • Use subtle 1px rules for professional article layouts
  • Match rule color to your design system palette
  • Use longhand properties when changing only color or style
  • Test rule visibility on light and dark backgrounds

❌ Don’t

  • Use very thick rules that dominate the layout
  • Forget column-gap — rules need gap space to show
  • Confuse column-rule with the element’s outer border
  • Use heavy dashed rules on narrow mobile columns
  • Assume rules replace the need for readable column spacing

Key Takeaways

Knowledge Unlocked

Five things to remember about column-rule

Use these points when styling column dividers.

5
Core concepts
02

Shorthand

Width style color.

Syntax
🔢 03

none Default

No rule shown.

Default
04

Needs gap

column-gap space.

Tip
🛸 05

Border styles

solid dashed dotted.

Values

❓ Frequently Asked Questions

column-rule defines the line drawn between columns in a multi-column layout. It is a shorthand for column-rule-width, column-rule-style, and column-rule-color.
The initial value is equivalent to medium none currentcolor, which means no visible rule appears between columns by default.
Yes. column-rule is drawn in the gap between columns. Set column-gap to a visible size so the rule has space to appear.
column-rule only appears between columns inside a multi-column container. border wraps the entire element's outer edge.
It supports the same line styles as border, including none, solid, dashed, dotted, double, groove, ridge, inset, and outset.

Practice in the Live Editor

Open the HTML editor, add column-rule: 5px solid black with column-count and column-gap.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful