CSS3 columnsProperty
Example
Specify the width and number of columns:
div
{
columns:100px 3;
-webkit-columns:100px 3; /* Safari and Chrome */
-moz-columns:100px 3; /* Firefox */
}
Try it Yourself »
More examples at the bottom of this page.
Browser Support
The numbers in the table indicate the first browser version that supports this property.
The number immediately preceding -webkit-, -ms-, or -moz- is the first browser version that supports the prefixed property.
| Property | |||||
|---|---|---|---|---|---|
| columns | 50.0 4.0 -webkit- |
10.0 | 9.0 -moz- | 9.0 3.1 -webkit- |
37.0 15.0 -webkit- 11.1 |
Property definition and usage instructions
The columns property is a shorthand property for setting the column width and the number of columns.
columns is a shorthand property for column-width and column-count.
| Default Value: | auto auto |
|---|---|
| Inherited: | no |
| version: | CSS3 |
| JavaScript Syntax: | object.style.columns="100px 3" |
Syntax
columns: column-width column-count;
| Value | Description |
|---|---|
| column-width | Column Width |
| column-count | column count |
More Examples
Column-count
The text of the div element is divided into three columns.
Column-gap
Divide the text in the div element into three columns, and specify a 30-pixel gap between the columns.
Column-rule
Specify the rule between columns: width, style, and color.
Related Articles
CSS3 Tutorial:CSS3 Multi-column
other extensions