08: Grid Basics
The CSS grids start off the same way as Flexbox by using the display: grid
property on a parent tag, and then the same setup of parent and child properties to control layout. The difference is that CSS grids are more for uniform layout.
I'm using the word "uniform" but that doesn't mean all of the cells need to be the same size. Uniform actually means that there are X columns by Y rows, even if each can have different sizes.
Simple 2D Uniform Grids
The simplest grid is where you give a parent tag the display: grid
property and then specify how the grid is formed with grid-template-columns
, grid-template-rows
, and grid-template-areas
.
Learn JavaScript Today
Register today for the Beginner Basics course and get the new releases by just paying the difference. There's also special discounts for existing customers when new courses are released.
Still Not Sure? Check out more curriculum!