CSS place-content property
Browser support · legacy reference
ChromeFully supports
SafariFully supports
FirefoxFully supports
Internet ExplorerFully supports
EdgeFully supports
OperaFully supports
Description
CSS place-content property aligns the content horizontally and vertically. It is a shorthand property of both align-content and justify-content.
Syntax
place-content : align-content justify-content
Property values
align-content
normalDefault
-
It stretches out the descendant elements to fill the height completely.
- Try it
align-content: normal; baseline
-
It aligns multiple objects (elements) on same shared space such as cells within a row.
- Try it
align-content: baseline; stretch
-
It stretches all of the objects (elements) in such a way that they occupy the full height of the container.
- Try it
align-content: stretch; flex-start
-
flex-start aligns the content at the start of flex container.
- Try it
align-content: flex-start; flex-end
-
flex-end aligns the content at the end of the flex container.
- Try it
align-content: flex-end; space-between
-
In this case, first object is aligned at the start of container and last object is aligned at the end of the container. The remaining objects are placed in such a way that white space is distributed equally among any two objects. Learn more about css space between.
- Try it
align-content: space-between; space-around
-
The objects are distributed in such a way that there is same space between the objects except at the start and end of the container. There is half sized space (half of the space that is between any two objects) before the first object and after the last object.
- Try it
align-content: space-around; space-evenly
-
It adjusts the alignment of objects so as to distribute equal space between and around the objects.
- Try it
align-content: space-evenly;
justify-content
normalDefault
-
It stretches out the descendant elements to fill the height completely.
- Try it
justify-content: normal; baseline
-
It aligns multiple objects (elements) on same shared space such as cells within a row.
- Try it
justify-content: baseline; stretch
-
It stretches all of the objects (elements) in such a way that they occupy the full height of the container.
- Try it
justify-content: stretch; flex-start
-
flex-start aligns the content at the start of flex container.
- Try it
justify-content: flex-start; flex-end
-
flex-end aligns the content at the end of the flex container.
- Try it
justify-content: flex-end; space-between
-
In this case, first object is aligned at the start of container and last object is aligned at the end of the container. The remaining objects are placed in such a way that white space is distributed equally among any two objects.
- Try it
justify-content: space-between; space-around
-
The objects are distributed in such a way that there is same space between the objects except at the start and end of the container. There is half sized space (half of the space that is between any two objects) before the first object and after the last object.
- Try it
justify-content: space-around; space-evenly
-
It adjusts the alignment of objects so as to distribute equal space between and around the objects.
- Try it
justify-content: space-evenly;
Applicable to
It applies to block containers, flex containers, and grid containers.