CSS column-rule Property

Description

The column-rule CSS property is used to define the style, color, and width of the rule (line) that separates columns within a multi-column layout. It allows web developers to customize the visual separation between columns in a more appealing and structured way. By specifying values for column-rule, such as color, width, and style, designers can create visually pleasing column layouts that enhance the readability and aesthetics of their web content. Individual properties are: column-rule-width, column-rule-style, and column-rule-color.

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="book">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. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
.book { 
   column-count: 3; 
   column-width: 200px; 
   column-rule: 2px solid red; 
   -moz-column-count: 3; 
   -moz-column-width: 200px; 
   -moz-column-rule: 2px solid red; 
   -webkit-column-count: 3; 
   -webkit-column-width: 200px; 
   -webkit-column-rule: 2px solid red; }

Browser Support

The following table will show you the current browser support for the CSS column-rule property.

Desktop
Edge Chrome Firefox Opera Safari
12505211.19
Tablets / Mobile
Chrome Firefox Opera Safari Samsung Webview
505211.19550

Last updated by CSSPortal on: 1st January 2024