CSS column-count Property
Description
The column-count
CSS property is used to specify the number of columns an element should be divided into when displayed in a multi-column layout. This property is often applied to container elements, such as
elements, to create a newspaper or magazine-style columnar arrangement of content. By setting the column-count value, designers can control the layout's structure and optimize the presentation of text or other content for better readability, especially on larger screens. This property works in conjunction with other CSS properties like column-gap and column-rule to fine-tune the appearance of columns within the container.
- Initial value
- auto
- Applies to
- Block level elements
- Inherited
- No
- Computed value
- Specified value
- Animatable
- No
- JavaScript syntax
- object.style.columnCount
Interactive Demo
The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.
Syntax
column-count: <integer> | auto
Values
- <integer>An integer value that specifies the number of columns in the multi-column element. Values must be greater than 0. When column-width is specified with column-count and both have non-auto values, the integer value defines the maximum number of columns.
- autoIs a keyword indicating that the number of columns should be determined by other CSS properties, like column-width.
Example
<div class="book">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>
.book {
-moz-column-count: 2;
-webkit-column-count: 2;
column-count: 2;
}
Browser Support
The following table will show you the current browser support for the CSS column-count
property.
Desktop | |||||
12 | 50 | 52 | 11.1 | 9 |
Tablets / Mobile | |||||
50 | 52 | 11.1 | 9 | 5 | 50 |
Last updated by CSSPortal on: 1st January 2024