And this repository, i will be uploading summary of course Css advanced with Flexbox and css grid.
What is CSS GRID? is a system of 2 dimention, Grid is a new form of create layouts, nothing framework you would has control on laouts you create.
CSS FLEXBOX is one dimention CSS GRID is two dimention
You can use FLEXBOX and GRID together
Important concepts
-Grid track Important If you define Grid axis row you had Grid track row.
-Grid Cell Similar a table of HTML
-Grid area A area can has several cells, when you agroup the cell you will have area
display: grid;
grid-template-columsn: 50% 25% 25%;
grid-tamplate-rows: 25% 25% 25% 25%;
-- grid-column: 1 / 2; -- grid-row: 1 / 5;
- grid-auto-flow: dense; column; row; // row es el default
- grid: row row / column column;
grid: 50% 50% / 33% 33% 33%
- grid-row: 1 / 3;
- grid-column: 1 / 3;
- Shorthand for grid-row and grid-column:
grid-area: 1 / 1 / 3 / 3;
grid-template-columns: 50% repeat(2, 25%);
grid: repeat(2, 50%) / repeat(3, 33%);
/*
template area
le pasas el nombre:
*/
grid-template-areas:
"header header header header"
"principal principal principal sidebar"
"footer footer footer footer"
No es bueno usar margin con los template, se recomienda usar:
grid-gap: 1rem;
grid-column-gap: 100px;
grid-row-gap: 100px;
grid-template-columns: 1fr 1fr;
grid-template-rows: 2fr 1fr 1fr;
Primero siempre sera row row, luego column column
grid: repeat(2, 1fr) / repeat(3, 1fr);
/*Vertical*/
/*UP vertical*/
align-items: start;
/*Horizontal*/
justify-content: center;
/*center horizontal*/
/*Space bettween*/
justify-content: space-between;
.contenedor{
grid-template-areas:
"header header header header"
"izquierda nav nav nav"
"izquierda contenido contenido derecha"
"izquierda contenido contenido derecha"
"footer footer footer derecha";
grid-template-columns: repeat(4, 1fr);
grid-template-rows: 80px 80px auto auto 80px;
grid-gap: 1rem;
}