HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

justify-content

Description

The justify-content property for CSS aligns the contents of the box as a whole within the box itself along the inline/row/main axis of the box.

Syntax

CSS

justify-content: value;

JS

object.style.justifyContent = "value";

Values

<'justify-content'> = normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]
normal

Represents the default alignment for the layout mode.

<content-distribution> = space-between | space-around | space-evenly | stretch
space-between

The alignment subjects are evenly distributed in the alignment container.

space-around

The alignment subjects are evenly distributed in the alignment container, with a half-size space on either end.

space-evenly

The alignment subjects are evenly distributed in the alignment container, with a full-size space on either end.

stretch

If the combined size of the alignment subjects is less than the size of the alignment container, any auto-sized alignment subjects have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container.

<overflow-position> = unsafe | safe
unsafe

Regardless of the relative sizes of the alignment subject and alignment container, the given alignment value is honored.

safe

If the size of the alignment subject overflows the alignment container, the alignment subject is instead aligned as if the alignment mode were start.

<content-position> = center | start | end | flex-start | flex-end
center

Centers the alignment subject within its alignment container.

start

Aligns the alignment subject to be flush with the alignment container's start edge in the appropriate axis.

end

Aligns the alignment subject to be flush with the alignment container's end edge in the appropriate axis.

flex-start

Aligns the alignment subject to be flush with the edge of the alignment container corresponding to the flex container's main-start or cross-start side, as appropriate. Only used in flex layout.

flex-end

Aligns the alignment subject to be flush with the edge of the alignment container corresponding to the flex container's main-end or cross-end side, as appropriate. Only used in flex layout.

left

Aligns the alignment subject to be flush with the alignment container's line-left or physical left edge, whichever is in the appropriate axis.

right

Aligns the alignment subject to be flush with the alignment container's line-right or physical right edge, whichever is in the appropriate axis.

Initial

normal

Examples

1 · normal

2 · content-distribution · space-between

3 · content-distribution · space-around

4 · content-distribution · space-evenly

5 · content-distribution · stretch

6 · overflow-position · unsafe

7 · overflow-position · safe

8 · content-position · center

9 · content-position · start

10 · content-position · end

11 · content-position · flex-start

12 · content-position · flex-end

13 · left

14 · right

15 · JS