Propiedad CSS grid-auto-columns
Ejemplo
Establezca un tamaño predeterminado para las columnas en una cuadrícula:
.grid-container {
display: grid;
grid-auto-columns: 50px;
}
Definición y uso
La grid-auto-columns
propiedad establece un tamaño para las columnas en un contenedor de cuadrícula.
Esta propiedad afecta solo a las columnas con el tamaño no establecido.
Valor por defecto: | auto |
---|---|
Heredado: | No |
Animable: | si. Leer sobre animable |
Versión: | Módulo de diseño de cuadrícula CSS Nivel 1 |
Sintaxis de JavaScript: | objeto .style.gridAutoColumns="120px" |
Compatibilidad con navegador
Los números de la tabla especifican la primera versión del navegador que es totalmente compatible con la propiedad.
Property | |||||
---|---|---|---|---|---|
grid-auto-columns | 57 | 16 | 52 | 10 | 44 |
Sintaxis CSS
grid-auto-columns: auto|max-content|min-content|length;
Valores de propiedad
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 |
páginas relacionadas
Tutorial de CSS: diseño de cuadrícula CSS
Referencia de CSS: la propiedad grid-auto-rows