CSSの複数の列
CSS複数列レイアウト
CSSの複数列のレイアウトにより、新聞のように、テキストの複数の列を簡単に定義できます。
毎日のPing
痛み自体は愛です だからこそ、私たちの通常の慣行が結果を利用するために耐えるのは、ほんの少しでも来るのです オリンピックの局の痛み、またはオリンピックの局の痛み、彼は結果に迷惑をかけたい、または彼は真実のeu免疫システムの痛みに苦しんでいます、エロスそして消費者、そしてzzrilの定期的な憎しみ。私たちがティーンエイジャーから解放された自由な時間のために選択の余地はありません
CSSの複数列のプロパティ
この章では、次の複数列のプロパティについて学習します。
column-count
column-gap
column-rule-style
column-rule-width
column-rule-color
column-rule
column-span
column-width
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
column-count | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-gap | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule-color | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule-style | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-rule-width | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
column-span | 50.0 | 10.0 | 71.0 | 9.0 | 37.0 |
column-width | 50.0 | 10.0 | 52.0 | 9.0 | 37.0 |
CSSは複数の列を作成します
このcolumn-count
プロパティは、要素を分割する列の数を指定します。
次の例では、<div>要素のテキストを3つの列に分割します。
例
div
{
column-count: 3;
}
CSS列間のギャップを指定する
プロパティは、列間のcolumn-gap
ギャップを指定します。
次の例では、列間に40ピクセルのギャップを指定しています。
例
div
{
column-gap: 40px;
}
CSS列ルール
column-rule-style
プロパティは、列間のルールのスタイルを指定します。
例
div
{
column-rule-style: solid;
}
プロパティは、列間のルールのcolumn-rule-width
幅を指定します。
例
div
{
column-rule-width: 1px;
}
このcolumn-rule-color
プロパティは、列間のルールの色を指定します。
例
div
{
column-rule-color: lightblue;
}
このcolumn-rule
プロパティは、上記のすべてのcolumn-rule- *プロパティを設定するための省略形のプロパティです。
次の例では、列間のルールの幅、スタイル、および色を設定します。
例
div
{
column-rule: 1px solid lightblue;
}
要素がまたがる列の数を指定する
このcolumn-span
プロパティは、要素がまたがる列の数を指定します。
次の例では、<h2>要素がすべての列にまたがることを指定しています。
例
h2 {
column-span: all;
}
列幅を指定する
プロパティは、列のcolumn-width
推奨される最適な幅を指定します。
次の例では、列の推奨される最適な幅を100pxにすることを指定しています。
例
div {
column-width: 100px;
}
CSS複数列のプロパティ
次の表に、すべての複数列のプロパティを示します。
Property | Description |
---|---|
column-count | Specifies the number of columns an element should be divided into |
column-fill | Specifies how to fill columns |
column-gap | Specifies the gap between the columns |
column-rule | A shorthand property for setting all the column-rule-* properties |
column-rule-color | Specifies the color of the rule between columns |
column-rule-style | Specifies the style of the rule between columns |
column-rule-width | Specifies the width of the rule between columns |
column-span | Specifies how many columns an element should span across |
column-width | Specifies a suggested, optimal width for the columns |
columns | A shorthand property for setting column-width and column-count |