CSS grid-auto-columns Eigenschap
Voorbeeld
Stel een standaardgrootte in voor de kolommen in een raster:
.grid-container {
display: grid;
grid-auto-columns: 50px;
}
Definitie en gebruik
De grid-auto-columns
eigenschap stelt een grootte in voor de kolommen in een rastercontainer.
Deze eigenschap is alleen van invloed op kolommen waarvan de grootte niet is ingesteld.
Standaardwaarde: | auto |
---|---|
geërfd: | Nee |
Animeerbaar: | Ja. Lees over animeren |
Versie: | CSS-rasterlay-outmodule niveau 1 |
JavaScript-syntaxis: | object .style.gridAutoColumns="120px" |
Browserondersteuning
De getallen in de tabel geven de eerste browserversie aan die de eigenschap volledig ondersteunt.
Property | |||||
---|---|---|---|---|---|
grid-auto-columns | 57 | 16 | 52 | 10 | 44 |
CSS-syntaxis
grid-auto-columns: auto|max-content|min-content|length;
Eigendomswaarden
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 |
Gerelateerde pagina's
CSS-zelfstudie: CSS-rasterlay-out
CSS-referentie: de eigenschap grid-auto-rows