What is the CSS justify-content Property?
The justify-content property aligns the entities in the containers when they do not utilize all available space on the horizontal axis. It is a sub-property of Flexible Box Layout. There are multiple values for this property, as shown below.
The syntax is as follows:
justify-content: flex-start|flex-end|center|space-between|
space-around|space-evenly|initial|inherit;
.container{
display: flex;
justify-content: flex-start;
}
Let’s look at the examples for each of these.
Note: For the demo presented below, you can see and play around with the HTML and CSS code by clicking on the respective tabs.