CSS: justify-content (flex, grid)
- This property is for the container of Flexbox or Grid layout.
- It specify how space is distributed for items along the flex flow direction or grid columns.
Position values
Positional alignment
justify-content: flex-start;-
default.
Aligns items to the start of the main axis. Ignores writing direction. Works only in Flexbox.
123 justify-content: flex-end;
justify-content: start;-
Aligns items to the start of the main axis. Respect writing direction. Works in both Flexbox and Grid.
justify-content: end;
justify-content: left;-
Forces alignment to the left side. Ignores writing direction. Only works in Flexbox, not in Grid.
justify-content: right;justify-content: center;-
123
Normal alignment
Distributed alignment
justify-content: space-between;-
123
justify-content: space-around;-
123
justify-content: space-evenly;-
123
Overflow alignment (for positional alignment only)
Overflow alignment (for positional alignment only)
justify-content: safe center;- xtodo
justify-content: unsafe center;- xtodo
CSS. flex layout
- CSS: Flexbox Layout
- CSS: flex-direction
- CSS: flex-wrap
- CSS: flex-flow
- CSS: gap, row-gap, column-gap (flex, grid)
- CSS: justify-content (flex, grid)
- CSS: justify-items (flex, grid)
- CSS: align-content (flex, grid)
- CSS: align-items (flex, grid)
- CSS: align-self (flex, grid)
- CSS: order (for flex items)
- CSS: flex (flex-grow, flex-shrink, flex-basis)
CSS grid layout
- CSS: Grid Layout
- CSS: grid-template-columns
- CSS: grid-template-rows
- CSS: grid repeat()
- CSS: grid-row, grid-column
- CSS: grid-area
- CSS: grid-template-areas
- CSS: gap, row-gap, column-gap (flex, grid)
- CSS: justify-content (flex, grid)
- CSS: justify-items (flex, grid)
- CSS: justify-self (grid)
- CSS: align-content (flex, grid)
- CSS: align-items (flex, grid)
- CSS: align-self (flex, grid)