CSS justify-items Property
The justify-items property aligns grid items along the inline (row) axis. It applies to grid containers and defines the default justify-self for all child items.
Common Values
- stretch (Default): Items fill the width of the cell.
- start: Items align to the start edge (left in LTR).
- end: Items align to the end edge (right in LTR).
- center: Items align to the center.
Justify-Items vs Align-Items
justify-items controls alignment on the horizontal (inline) axis.
align-items controls alignment on the vertical (block) axis.
Best Practices
Use justify-items on the parent container to set a global alignment for all children. If you need a specific child to differ, use justify-self on that specific item.
