Column Count: Divide the text in the <div> element into three columns:
div {
-webkit-column-count: 3; /* Chrome, Safari, Opera */
-moz-column-count: 3; /* Firefox */
column-count: 3;
}
More “Try it Yourself” examples below.
Definition and Usage
The column-count property specifies the number of columns an element should be divided into.
| Default value: | auto |
|---|---|
| Inherited: | no |
| Animatable: | yes. Read about animatable – Try it |
| Version: | CSS3 |
| JavaScript syntax: | object.style.columnCount=3 Try it |
CSS Syntax
column-count: number|auto|initial|inherit;
Property Values
| Value | Description |
|---|---|
| number | The optimal number of columns into which the content of the element will be flowed |
| auto | Default value. The number of columns will be determined by other properties, like e.g. “column-width” |
| initial | Sets this property to its default value. Read about initial |
| inherit | Inherits this property from its parent element. Read about inherit |
Specify a 40 pixels gap between the columns:
div {
-webkit-column-gap: 40px; /* Chrome, Safari, Opera */
-moz-column-gap: 40px; /* Firefox */
column-gap: 40px;
}
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;
}
