Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

CSS3 column-count property

CSS3 column-count property

Example

Divide the text in a div element into three columns:

div

{

column-count:3;

-moz-column-count:3; /* Firefox */

-webkit-column-count:3; /* Safari and Chrome */

}

Try it »

There are more examples at the bottom of this page.


Browser support

The numbers in the table indicate the first browser version that supports this property.

A number immediately before -webkit-, -ms-, or -moz- indicates the first browser version that supports that prefixed property.

property
column-count 50.0
4.0 -webkit- 10.0 2.0 -moz- 9.0
3.1 -webkit- 37.0
 15.0 -webkit       
 11.1 |

Property definition and usage

The column-count property specifies the number of columns an element should be divided into.

Default value: auto
Inherited: no
Version: CSS3
JavaScript syntax: object.style.columnCount=3

Syntax

column-count:

number

|auto;

Value Description
number The optimal number of columns so that the content of the element does not overflow
auto The number of columns will depend on other properties, such as "column-width"

Try it Yourself - Examples

Column-gap
Divide the text in a 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 Multiple Columns