CSS Grid Layout

Este layout te permite infinidad de estructuras partiendo de una base sólida, definiendo según tu necesidad la cantidad de columnas y rows que utilizaras para tu diseño y sus 'cajas'.

Cómo lo aplico?

Como sucede en el Masonry Layout por defecto tenemos en nuestro archivo _variables seteado la cantidad de columnas por defecto y el quiebre (Breakpoint) de cada una.

  • --gridBox-height -- Valor en pixels o en porcentaje. Define la cantidad de columnas de nuestro layout (seteado por defecto el 33.3%).
  • --grid-main-padding -- Valor de padding de cada uno de nuestros items
  • --grid-column-space -- Valor de espacios entre columnas

Sabiendo esto ya podemos comenzar a crear, organizar nuestro layout principal. Existen dos propiedades fundamentales que debemos setearle a nuestros 'divs hijos' para la construcción de este layout:

  • grid-row-end: span N; -- Nuestro Row ocupara N 'renglones' de alto
  • grid-column-end: span N; -- Nuestra columna se 'estirara' ocupando N columnas de ancho (este numero NO puede exceder el numero total de columnas de nuestro layout)

Estas dos propiedades al igual que cualquier propiedad en CSS acepta media queries lo que significa que podemos varias anchos y altos de nuestra grilla dependiendo del viewport.


Ejemplo Layout

1. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

2. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

3. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

4. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

5. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

6. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

7. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

8. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction

9. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

10. Titulo de la Caja

The second concept is to give our masonry container (.masonry) a fixed height and then set the flex-direction to column. This technique is not so handy, as you will have to tweak up the height of the container everytime you add new items to the masonry.

<div class="grid-layout">
<div>...</div>
...
</div>
dosLotos Grid v.1.1.1
Autor Carlos 'Ruso' Cucurullo
doslotos ©