CSS Portal

CSS column-rule Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The column-rule property controls the visual divider drawn between columns inside an element that uses a multi-column layout. It acts as a shorthand for the individual aspects of that divider - column-rule-width, column-rule-style, and column-rule-color - allowing you to set thickness, rendering style, and color together. Conceptually, it is a decorative box-decoration applied where columns are separated, and is only meaningful when the element actually establishes multiple columns (for example via properties such as column-count or column-width).

Visually, the rule is painted in the inter-column area and typically appears centered within the space determined by the layout’s gap; that gap is controlled by the column-gap property. Because the rule occupies the inter-column region, designers should consider how it interacts with column backgrounds and any decorative strokes - it is intended as a clear separator to improve legibility and organization in multi-column content. Using the rule alongside background or box-decoration adjustments can create strong visual columns without changing the flow of text.

Interaction with content that spans columns is an important behavior to keep in mind: elements that span across multiple columns will interrupt or omit the rule where they occupy that space, so the divider will not be drawn across spanned content (see column-span). Similarly, the rule follows the flow of the columnized element across fragmentation boundaries - it’s tied to the multi-column formatting context rather than to page or region edges of sibling boxes.

From a practical perspective, column-rule is useful for typographic and magazine-style layouts where visual separation is needed without additional markup. Because it’s a shorthand for the three underlying rule properties, you can choose to manage each aspect independently when you need fine-grained control (width, style, color) or set them together for convenience. Keep in mind that the rule’s appearance is determined by the multi-column environment around it - adjusting the column count, width, or gap will influence how prominent or subtle the divider appears.

Definition

Initial value
See individual properties
Applies to
Multi-column elements
Inherited
No
Computed value
See individual properties
Animatable
No
JavaScript syntax
object.style.columnRule

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.

Syntax

column-rule: <column-rule-width> || <column-rule-style> || [ <column-rule-color> | transparent ] 

Values

Example

<div class="columns">
<h2>CSS column-rule example</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum.</p>
<p>Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra.</p>
<p>Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Aenean quam. In scelerisque sem at dolor. Maecenas mattis.</p>
</div>
.columns {
  max-width: 900px;
  margin: 32px auto;
  padding: 20px;
  background: #ffffff;
  color: #222222;
  -webkit-column-count: 3;
  -moz-column-count: 3;
  column-count: 3;
  -webkit-column-gap: 24px;
  -moz-column-gap: 24px;
  column-gap: 24px;
  -webkit-column-rule: 4px dotted #8a8a8a;
  -moz-column-rule: 4px dotted #8a8a8a;
  column-rule: 4px dotted #8a8a8a;
}

.columns h2 {
  margin-top: 0;
}

.columns p {
  margin: 0 0 16px;
}

Browser Support

The following information will show you the current browser support for the CSS column-rule property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!