Style columnsプロパティ

Style 对象参考手册Style オブジェクト

例

テキストを3列に分割し、各列の最小幅を100ピクセルにします:

document.getElementById("myDIV").style.columns="100px 3";

試してみる »

定義と使い方

columns プロパティは、columnWidth と columnCount を設定するためのショートハンドプロパティです。


ブラウザサポート

Internet Explorer Firefox Opera Google Chrome Safari

Internet Explorer 10 と Opera は columns プロパティをサポートしています。

Firefox は、このプロパティの代替となる MozColumns プロパティをサポートしています。

Safari と Chrome は、このプロパティの代替となる WebkitColumns プロパティをサポートしています。


構文

columns プロパティを返す:

object.style.columns

columns プロパティを設定する:

object.style.columns="auto|column-width column-count|initial|inherit"

プロパティ値

值 説明
auto デフォルト値。column-width を "auto"、column-count を "auto" に設定します。
columnWidth 列の幅。
columnCount 列数。
initial このプロパティをデフォルト値に設定します。参照:initial。
inherit 親要素からこのプロパティを継承します。参照:inherit。

技術詳細

デフォルト値: auto auto
戻り値: 要素の columns プロパティを表す文字列。
CSS バージョン CSS3


関連記事

CSS3 チュートリアル:CSS3 マルチカラム

CSS リファレンス:columns プロパティ


Style 对象参考手册Style オブジェクト

その他の拡張