CSS justify-items property

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 : baseline | center | stretch | flex-start | flex-end

Property values

autoDefault

It stretches out the element vertically to fill the width of container completely.

justify-items: auto;

baseline

It aligns the element on the baseline.

justify-items: baseline;

center

It aligns the content at the middle of cotainer.

justify-items: center;

stretch

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

justify-items: stretch;

flex-start

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

justify-items: flex-start;

flex-end

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

justify-items: flex-end;

Applicable to

It applies to all elements

#CSS digger
Was this article helpful?

 

#First 1

×

Ctrl+D