place-items

A shorthand for setting both align-items and justify-items in a single property. It's incredibly useful for quick centering in CSS Grid.

It is documented as part of the CSS Box Alignment specification.

/* Usage Example */
.grid-container {
  display: grid;
  place-items: center;
  /* perfectly centers content both ways */
}

/* Syntax */
place-items: align-items;
place-items: justify-items;

/* Global values */
place-items: inherit;
place-items: initial;
place-items: revert;
place-items: revert-layer;
place-items: unset;
Widely available Since 2015 95% global usage

This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.

59+
45+
11+
79+
Kinsta

Your first month is free

Managed WordPress hosting for faster sites.

Learn more

New CSS drops.

Join 600+ readers who've survived clearfix hacks.

ESC