column-count

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.

column-countCSS のプロパティで、要素のコンテンツを指定された段数の段組みに分割します。

試してみましょう

column-count: 2;
column-count: 3;
column-count: 4;
column-count: auto;
column-width: 8rem;
<section id="default-example">
  <p id="example-element">
    London. Michaelmas term lately over, and the Lord Chancellor sitting in
    Lincoln's Inn Hall. Implacable November weather. As much mud in the streets
    as if the waters had but newly retired from the face of the earth, and it
    would not be wonderful to meet a Megalosaurus, forty feet long or so,
    waddling like an elephantine lizard up Holborn Hill.
  </p>
</section>
#example-element {
  width: 100%;
  text-align: left;
}

構文

css
/* キーワード値 */
column-count: auto;

/* <integer> 値 */
column-count: 3;

/* グローバル値 */
column-count: inherit;
column-count: initial;
column-count: revert;
column-count: revert-layer;
column-count: unset;

auto

段組みの段数は column-width など、他の CSS プロパティによって決定されます。

<integer>

正の整数のみで、要素の中で流れる理想的な段の数を記述します。 column-widthauto 以外の値で一緒に設定された場合は、最大の段数を示します。

公式定義

初期値auto
適用対象表ラッパーボックスを除くブロックコンテナー
継承なし
計算値指定通り
アニメーションの種類integer

形式文法

column-count = 
auto |
<integer [1,∞]>

段落を 3 つの段に分割

HTML

html
<p class="content-box">
  これは、 CSS の <code>column-count</code> プロパティを使用して 3 つの段に分割されたテキストの束です。テキストはそれぞれの段に均等に配置されています。
</p>

CSS

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

結果

仕様書

Specification
CSS Multi-column Layout Module Level 1
# cc

ブラウザーの互換性

関連情報