CSS <content-distribution> Data Type
The <content-distribution> data type is a keyword that shares out extra space between items: space-between, space-around, space-evenly or stretch.
Description
The <content-distribution> CSS data type represents the keywords that spread extra space between or around the items of a flex or grid container, rather than moving the items as a group. It is used by justify-content, align-content and the place-content shorthand.
The four keywords differ in how the leftover space is shared. space-between puts the first item at the start, the last at the end, and equal gaps between them. space-around gives every item an equal amount of space on each side, so the gaps at the edges are half the size of the gaps between items. space-evenly makes every gap the same, including the edges. stretch grows auto-sized items (or grid tracks) to fill the space instead of adding gaps.
If there is not enough space to distribute, or only one item, each keyword falls back to a <content-position>: space-between behaves like flex-start, space-around and space-evenly behave like center, and stretch behaves like flex-start.
Examples:
.toolbar {
display: flex;
justify-content: space-between;
}
.gallery {
display: grid;
grid-template-columns: repeat(3, 120px);
justify-content: space-evenly;
}
.rows {
display: flex;
flex-wrap: wrap;
height: 400px;
align-content: space-around;
}
Interactive Demo
Syntax
<content-distribution> = space-between | space-around | space-evenly | stretch
Values
- space-betweenThe first item is at the start, the last at the end, and the remaining space is shared equally between the items.
- space-aroundEach item gets an equal amount of space on both sides, so the gaps at the edges are half the gaps between items.
- space-evenlyAll gaps, including those at the start and end, are the same size.
- stretchAuto-sized items or tracks grow to fill the available space.
Example
Browser Support
The following information will show you the current browser support for the CSS content-distribution data type. Hover over a browser icon to see the version that first introduced support for this CSS data type.
Desktop





Tablets & Mobile





