Propiedad CSS grid-auto-flow
Ejemplo
Inserte elementos colocados automáticamente columna por columna:
.grid-container {
display: grid;
grid-auto-flow:
column;
}
Definición y uso
La grid-auto-flow
propiedad controla cómo se insertan en la cuadrícula los elementos colocados automáticamente.
Valor por defecto: | hilera |
---|---|
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.gridAutoFlow="fila densa" |
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-flow | 57 | 16 | 52 | 10 | 44 |
Sintaxis CSS
grid-auto-flow:
row|column|dense|row dense|column dense;
Valores de propiedad
Value | Description | Play it |
---|---|---|
row | Default value. Places items by filling each row | |
column | Places items by filling each column | |
dense | Place items to fill any holes in the grid | |
row dense | Places items by filling each row, and fill any holes in the grid | |
column dense | Places items by filling each column, and fill any holes in the grid |
Más ejemplos
Ejemplo
Rellene los agujeros en la cuadrícula agregando el valor "denso":
.grid-container {
display: grid;
grid-auto-flow: row
dense;
}
páginas relacionadas
Tutorial de CSS: diseño de cuadrícula CSS