Grid by Example

A collection of usage examples for the CSS Grid Layout specification.

Box alignment align-items

I have used a grid background image to show the grid in this example. I’ve defined 4 equal sized grid areas on the left which cover a square area inside three row and column lines.

I’m using the align-items property with a value of center. This centres the content of all of the grid items.

Read the specification | View example as full page

See the Pen Grid by Example 24: align-items by rachelandrew (@rachelandrew) on CodePen.

Back to list of examples