Rule Property: Specify the width, style, and color of the rule between columns:
div {
-webkit-column-rule: 4px double #ff00ff; /* Chrome, Safari, Opera */
-moz-column-rule: 4px double #ff00ff; /* Firefox */
column-rule: 4px double #ff00ff;
}
More “Try it Yourself” examples below.
Definition and Usage
The column-rule property sets the width, style, and color of the rule between columns.
This property is a shorthand property for the column-rule-width, column-rule-style and column-rule-color properties.
| Default value: | medium none color |
|---|---|
| Inherited: | no |
| Animatable: | yes, see individual properties. Read about animatable – Try it |
| Version: | CSS3 |
| JavaScript syntax: | object.style.columnRule=”3px outset blue” Try it |
CSS Syntax
column-rule: column-rule-width column-rule-style column-rule-color|initial|inherit;
Property Values
| Value | Description |
|---|---|
| column-rule-width | Sets the width of the rule between columns. Default value is medium |
| column-rule-style | Sets the style of the rule between columns. Default value is none |
| column-rule-color | Sets the color of the rule between columns. Default value is the color of the element |
| initial | Sets this property to its default value. Read about initial |
| inherit | Inherits this property from its parent element. Read about inherit |
Divide the text in a <div> element into three columns:
div {
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
}
Specify a 40 pixels gap between the columns:
div {
-webkit-column-gap: 40px; /* Chrome, Safari, Opera */
-moz-column-gap: 40px; /* Firefox */
column-gap: 40px;
}
