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
Syntax
column-rule: <column-rule-width> || <column-rule-style> || [ <column-rule-color> | transparent ]
Values
- <column-rule-width>See column-rule-width CSS property for values.
- <column-rule-style>See column-rule-style CSS property for values.
- <column-rule-color>See column-rule-color CSS property for 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 | |||||
![]() |
![]() |
![]() |
![]() |
![]() |
|
12 | 50 | 52 | 11.1 | 9 |
Tablets / Mobile | |||||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
50 | 52 | 11.1 | 9 | 5 | 50 |
Last updated by CSSPortal on: 1st January 2024