Web4College

CSS justify-items property

src

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.

justify-items: normal;
Try it

stretch

It stretches the element so as fill the width of container completely.

justify-items: stretch;
Try it

center

It aligns the content at the middle of cotainer.

justify-items: center;
Try it

flex-start

flex-start aligns the current element at the start of grid container.

justify-items: flex-start;
Try it

flex-end

flex-end aligns the current element at the end of the grid container.

justify-items: flex-end;
Try it

Applicable to

It applies to multicol containers and grid containers..