--- title: column-span slug: Web/CSS/column-span tags: - CSS - CSS Multi-column Layout - CSS Property - Reference - 'recipe:css-property' translation_of: Web/CSS/column-span ---
column-span は CSS のプロパティで、値に all を設定した場合、段組みレイアウトで要素をすべての段にまたがらせることができます。
/* キーワード値 */ column-span: none; column-span: all; /* グローバル値 */ column-span: inherit; column-span: initial; column-span: unset;
複数の段にまたがる要素は、スパニング要素と呼びます。
column-span プロパティは以下に挙げたキーワード値のうちの一つで指定します。
noneall{{cssinfo}}
この例では、見出しが記事のすべての段にまたがって作成されます。
<article>
<h2>Header spanning all of the columns</h2>
<p>
The h2 should span all the columns. The rest
of the text should be distributed among the columns.
</p>
<p>This is a bunch of text split into three columns using the CSS `columns` property. The text is equally distributed over the columns.</p>
<p>This is a bunch of text split into three columns using the CSS `columns` property. The text is equally distributed over the columns.</p>
<p>This is a bunch of text split into three columns using the CSS `columns` property. The text is equally distributed over the columns.</p>
<p>This is a bunch of text split into three columns using the CSS `columns` property. The text is equally distributed over the columns.</p>
</article>
article {
columns: 3;
}
h2 {
column-span: all;
}
{{EmbedLiveSample('Making_a_heading_span_columns', 'auto', 260)}}
| 仕様書 | 状態 | 備考 |
|---|---|---|
| {{SpecName('CSS3 Multicol', '#column-span', 'column-span')}} | {{Spec2('CSS3 Multicol')}} | 初回定義 |
{{Compat("css.properties.column-span")}}