column-count CSS property breaks an element's content into the specified number of columns.

The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.

句法

/* Keyword value */
column-count: auto;
/* <integer> value */
column-count: 3;
/* Global values */
column-count: inherit;
column-count: initial;
column-count: unset;
					

auto
The number of columns is determined by other CSS properties, such as column-width .
<integer>
Is a strictly positive <integer> describing the ideal number of columns into which the content of the element will be flowed. If the column-width is also set to a non- auto value, it merely indicates the maximum allowed number of columns.

形式定义

初始值 auto
适用于 Block containers except table wrapper boxes
继承 no
计算值 如指定
动画类型 an integer

形式句法

<integer> | auto
					

范例

Splitting a paragraph across three columns

HTML

<p class="content-box">
  This is a bunch of text split into three columns
  using the CSS `column-count` property. The text
  is equally distributed over the columns.
</p>
					

CSS

.content-box {
  column-count: 3;
}
					

结果

规范

规范 状态 注释
CSS Multi-column Layout Module
The definition of 'column-count' in that specification.
工作草案 初始定义。

浏览器兼容性

The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
column-count Chrome 完整支持 50 Edge 完整支持 12 Firefox 完整支持 52
完整支持 52
不支持 1.5 — 74 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -moz-
注意事项 Prior to version 37, multiple columns didn't work with display: table-caption elements.
IE 完整支持 10 Opera 完整支持 11.1 Safari 完整支持 9 WebView Android 完整支持 50 Chrome Android 完整支持 50 Firefox Android 完整支持 52
完整支持 52
完整支持 4 Prefixed 注意事项
Prefixed Implemented with the vendor prefix: -moz-
注意事项 Prior to version 37, multiple columns didn't work with display: table-caption elements.
Opera Android 完整支持 11.1 Safari iOS 完整支持 9 Samsung Internet Android 完整支持 5.0

图例

完整支持

完整支持

见实现注意事项。

见实现注意事项。

要求使用供应商前缀或不同名称。

要求使用供应商前缀或不同名称。

另请参阅

元数据

  • 最后修改: