Flexbox & Grid

place-items

Setting align-items and justify-items at the same time.

Overview

ClassDeclarations
place-items:normalplace-items: normal;
place-items:baselineplace-items: baseline;
place-items:centerplace-items: center;
place-items:stretchplace-items: stretch;
place-items:startplace-items: start;
place-items:endplace-items: end;
place-items:flex-startplace-items: flex-start;
place-items:flex-endplace-items: flex-end;
place-items:self-startplace-items: self-start;
place-items:self-endplace-items: self-end;
place-items:<align-items>|<justify-items>place-items: <align-items> <justify-items>;

Examples

Align grid items on both axes

Use place-items:* as shorthand for align-items and justify-items.

<div class="grid place-items:center h:48x">    <button>Centered</button></div>
Generated CSS
@layer utilities {    .grid {        display: grid    }    .place-items\:center {        place-items: center    }    .h\:48x {        height: 12rem    }}

Stretch items

Use place-items:stretch when children should fill their grid areas in both axes.

<section class="grid place-items:stretch">...</section>

Use place-self when only one item needs a different two-axis alignment.

Apply conditionally

Apply styles based on different states using selectors and conditional queries.

<div class="place-items:stretch place-items:center@sm place-items:stretch@print">...</div>

For flexbox, place-items has limited use; prefer align-items and justify-content.


  • Master UI


© 2026 Aoyue Design LLC.MIT License
Trademark Policy