CSSgrid -auto-columnsプロパティ
例
グリッド内の列のデフォルトサイズを設定します。
.grid-container {
display: grid;
grid-auto-columns: 50px;
}
定義と使用法
このgrid-auto-columns
プロパティは、グリッドコンテナの列のサイズを設定します。
このプロパティは、サイズが設定されていない列にのみ影響します。
デフォルト値: | 自動 |
---|---|
遺伝性の: | いいえ |
アニメート可能: | はい。アニメート可能について読む |
バージョン: | CSSグリッドレイアウトモジュールレベル1 |
JavaScript構文: | オブジェクト.style.gridAutoColumns = "120px" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
Property | |||||
---|---|---|---|---|---|
grid-auto-columns | 57 | 16 | 52 | 10 | 44 |
CSS構文
grid-auto-columns: auto|max-content|min-content|length;
プロパティ値
Value | Description | Play it |
---|---|---|
auto | Default value. The size of the columns is determined by the size of the container | |
fit-content() | ||
max-content | Sets the size of each column depending on the largest item in the column | |
min-content | Sets the size of each column depending on the smallest item in the column | |
minmax(min.max) | Sets a size range greater than or equal to min and less than or equal to max | |
length | Sets the size of the columns, by using a legal length value. Read about length units | |
% | Sets the size of the columns, by using a percent value |
関連ページ
CSSチュートリアル:CSSグリッドレイアウト
CSSリファレンス:grid-auto-rowsプロパティ