Container alignment

Properties that control how items are aligned inside each grid cell.
  • justify-items: aligns items horizontally within each cell.
  • align-items: aligns items vertically within each cell.
  • place-items: shorthand to combine justify-items and align-items.
  • Possible values:
  • stretch: Stretches the item to fill the entire cell (default).
  • start: Aligns to the start of the cell (left for horizontal, top for vertical).
  • center: Centers the item within the cell.
  • end: Aligns to the end of the cell (right for horizontal, bottom for vertical).

Example

In this dynamic example, we can see the different alignments of cells using justify-items and align-items.

Select justify-items:
Select align-items:
ResultLive
html
css