CSS Grid (Part 1)

Understanding the Grid Container and Grid Items

The CSS Grid layout is based on a grid container that holds grid items. The grid container is defined using the display: grid; property.

  • Defining a Grid Container

In this example, .grid-container sets up a grid with two columns of equal width and a gap between items.

Tutorials dojo strip
CSS




Placing Grid Items

Grid items are placed within the grid container using the grid-column and grid-row properties.

  • Placing Items in Specific Grid Areas:
CSS




CSS Grid (Part 1) Example Code

CSS




CSS Labs

Tutorials dojo strip