- Grids allow us to create layouts using rows and columns approach
- It is very similar to flexbox but flexbox is used for 1D and Grids for 2D
Container
grid-template-columnsused to define number of columns
grid-template-rowsused to defined rows
frunit is used in grids means one equal fraction which is usually used withrepeat(2, 1fr)
- The gap property is used to give gaps between elements, we also have
column-gapandrow-gap
- GRIDS:
gtc,gtr,repeat,1fr,align/justifyitems/content.
Child
- align/justify self & grid-row-start/end, grid-column-start/end
- place-items property is used for align-items and justify-items shorthand
- Grid Lines
.features-inner { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
PROJECT: Codepen
PROJECT: (SELECT FASHION MOD-05 SCENE)