CSS justify-content Property
The justify-content property defines how the browser distributes space between and around content items along the main-axis of a flex container, and the inline axis of a grid container.
The justify-content property aligns flex items along the main axis of the current line of the flex container.
This is done after any flexible lengths and any auto margins have been resolved.
Typically it helps distribute extra free space leftover when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size.
It also exerts some control over the alignment of items when they overflow the line.
The numbers in the table specify the first browser version that fully supports the property.
The following table describes the values of this property.
|The items are packed in their default position as if no justify-content value was set. This value behaves as stretch in grid and flex containers.
|Specifies participation inbaseline alignment.
|The items are packed flush to each other toward the start edge of the alignment container in the main axis.
|The items are packed flush to each other toward the end edge of the alignment container in the main axis.
|This is default value. Items are packed toward the start of the line.
|Items are packed toward the end of the line.
|Items are packed toward the center of the line.
|The items are packed flush to each other toward the left edge of the alignment container. If the property's axis is not parallel with the inline axis, this value behaves like start.
|The items are packed flush to each other toward the right edge of the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis, this value behaves like start.
|If the combined size of the items along the main axis is less than the size of the alignment container, any auto-sized items 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 along the main axis.
|Items are evenly distributed along the line.
|Items are evenly distributed so that the space between two adjacent items is the same.
|Items will have equal space around them.
|Used alongside an alignment keyword. If the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start.
|Used alongside an alignment keyword. Regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might happen, the given alignment value is honored.
|Sets this property to its default value.
|If specified, the associated element takes the computed value of its parent element animation-delay property.
|Reverts the cascaded value of the property from its current value to the value the property
|Rollback styles to the ones specified in previous cascade layers.
|Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.
Default CSS Property Values
grid-template: 120px 120px / auto auto auto;