Flexbox & Grid

justify-items

Controlling how items are aligned along its inline axis.

Overview

ClassDeclarations
justify-items:normaljustify-items: normal;
justify-items:baselinejustify-items: baseline;
justify-items:leftjustify-items: left;
justify-items:centerjustify-items: center;
justify-items:rightjustify-items: right;
justify-items:stretchjustify-items: stretch;
justify-items:legacyjustify-items: legacy;
justify-items:startjustify-items: start;
justify-items:endjustify-items: end;
justify-items:flex-startjustify-items: flex-start;
justify-items:flex-endjustify-items: flex-end;
justify-items:self-startjustify-items: self-start;
justify-items:self-endjustify-items: self-end;
justify-items:<value>justify-items: <value>;

Examples

Align grid items inline

Use justify-items:* to set the default inline-axis alignment for children in a grid container.

<div class="grid justify-items:center">    ...</div>
Generated CSS
@layer utilities {    .grid {        display: grid    }    .justify-items\:center {        justify-items: center    }}

Stretch items by default

Use justify-items:stretch when grid children should fill their grid areas inline.

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

Use justify-self when only one grid item needs different alignment.

Apply conditionally

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

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

For flexbox main-axis distribution, use justify-content instead.


  • Master UI


© 2026 Aoyue Design LLC.MIT License
Trademark Policy