CSS justify-items property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
Description
CSS justify-items property aligns child items horizontally (main/inline/row axis) within its container by adjusting the margins. We are using a grid container as an example.
Syntax
justify-items : normal | stretch | center | flex-start | flex-end
Property values
normalDefault
-
It stretches out the element horizontally to fill the width of container completely.
- Try it
justify-items: normal; stretch
-
It stretches the element so as fill the width of container completely.
- Try it
justify-items: stretch; flex-start
-
flex-start aligns the current element at the start of grid container.
- Try it
justify-items: flex-start; flex-end
-
flex-end aligns the current element at the end of the grid container.
- Try it
justify-items: flex-end;
Applicable to
It applies to multicol containers and grid containers..