English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Complete List of CSS Properties

CSS3 column-count Attribute Usage and Examples

column-The count CSS attribute specifies the number of columns in a multi-column element.

The following table provides usage instructions and version history of this attribute, as well as the usage syntax of this attribute in JavaScript scripts.

Default Value:auto
Applies To:Non-replacedBlock Elementsexcept for table elements), table cells, andInline Block Elements
Inheritance:No
Animatable:Yes.Animation Attributes.
Version: CSS3New Feature
JavaScript Syntax:object.style.columnCount=5

column-count Usage Syntax

The syntax of this attribute is as follows:

column-count: auto | initial | inherit

The following examples demonstrate how to use column-count Attribute.

p {
    -webkit-column-count: 3; /* Chrome, Safari, Opera */
       -moz-column-count: 3; /* Firefox */
            column-count: 3; 
}
Test and See‹/›

Attribute Values

The following table describes the values of this attribute.

ValueDescription
numberA positive integer value used to specify the number of columns in a multi-column element. Ifcolumn-widthIf this property is also set to a non-auto value, it may indicate the maximum number of columns allowed.
autoThe number of columns is determined by other CSS attributes, such ascolumn-width. This is the default value.
initialSet this attribute to its default value.
inheritIf specified, the associated elements will use their parent element's column-count Attribute Values.

Browser Compatibility

column-Browser Compatibility of count Attribute, the numbers in the following table represent the minimum version number of browsers that support this attribute; all mainstream browsers support this attribute.

  • Firefox 2+ -moz-

  • Google Chrome 4+ -webkit-

  • Internet Explorer 10+

  • Apple Safari 3.1+ -webkit-

  • Opera 11.1+ -o-,15+ -webkit-

Further Reading

Please refer to the following tutorials:CSS3Multi-column Layout.

Related Attributes:column-width,column-gap,column-rule,column-rule-width,column-rule-style,column-rule-color,column-span,column-fill,columns.