Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

CSS3 column-count property


May 05, 2021 CSS Reference Manual


Table of contents


Divide the text in the div element into three columns:

div
{
-moz-column-count:3; /* Firefox */
-webkit-column-count:3; /* Safari 和 Chrome */
column-count:3;
}

Give it a try yourself

There are more instances at the bottom of the page.

Browser support

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

Internet Explorer 10 and Opera support the column-count property.

Firefox supports alternative -moz-column-count properties.

Safari and Chrome support alternative -webkit-column-count properties.

Note: Internet Explorer 9 and earlier browsers do not support the column-count property.

Definitions and usages

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

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

Grammar

column-count: number|auto;
Value Describe Test
number The optimal number of columns in which the element content will be divided. Test
auto The number of columns is determined by other properties, such as "column-width". Test

Try it yourself - example

Column-gap
Divide the text in the div element into three columns and specify a 30-pixel interval between columns.
Column-rule
Specifies the width, style, and color between columns.

Related pages

CSS3 tutorial: CSS3 multiple columns