CSS - Eigenschaft grid-auto-columns
Beispiel
Legen Sie eine Standardgröße für die Spalten in einem Raster fest:
.grid-container {
display: grid;
grid-auto-columns: 50px;
}
Definition und Verwendung
Die grid-auto-columns
Eigenschaft legt eine Größe für die Spalten in einem Rastercontainer fest.
Diese Eigenschaft betrifft nur Spalten mit nicht festgelegter Größe.
Standardwert: | Auto |
---|---|
Vererbt: | Nein |
Animierbar: | ja. Lesen Sie mehr über animierbare |
Ausführung: | CSS-Grid-Layout-Modul Stufe 1 |
JavaScript-Syntax: | Objekt .style.gridAutoColumns="120px" |
Browser-Unterstützung
Die Zahlen in der Tabelle geben die erste Browserversion an, die die Eigenschaft vollständig unterstützt.
Property | |||||
---|---|---|---|---|---|
grid-auto-columns | 57 | 16 | 52 | 10 | 44 |
CSS-Syntax
grid-auto-columns: auto|max-content|min-content|length;
Eigenschaftswerte
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 |
Verwandte Seiten
CSS-Tutorial: CSS-Grid-Layout
CSS-Referenz: Die Eigenschaft grid-auto- rows