Propriété CSS grid-auto-columns
Exemple
Définissez une taille par défaut pour les colonnes d'une grille :
.grid-container {
display: grid;
grid-auto-columns: 50px;
}
Définition et utilisation
La grid-auto-columns
propriété définit une taille pour les colonnes dans un conteneur de grille.
Cette propriété affecte uniquement les colonnes dont la taille n'est pas définie.
Valeur par défaut: | auto |
---|---|
Hérité: | non |
Animable : | Oui. En savoir plus sur l'animation |
Version: | Module de disposition de grille CSS niveau 1 |
Syntaxe JavaScript : | objet .style.gridAutoColumns="120px" |
Prise en charge du navigateur
Les nombres dans le tableau indiquent la première version du navigateur qui prend entièrement en charge la propriété.
Property | |||||
---|---|---|---|---|---|
grid-auto-columns | 57 | 16 | 52 | 10 | 44 |
Syntaxe CSS
grid-auto-columns: auto|max-content|min-content|length;
Valeurs de propriété
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 |
Pages connexes
Tutoriel CSS : Mise en page de la grille CSS
Référence CSS : La propriété grid-auto-rows