justify-content
![](/_next/image/?url=https%3A%2F%2Fstatic-staging.d-libro.com%2F01-course-content-images%2F1011-10-HTML-CSS-Introduction%2F010-main-figures%2Fjustify-content-id101110150510.webp&w=1920&q=75)
The justify-content
property is used for setting a layout pattern of flex items (nested child elements) along the main axis of the flex container. The main axis is typically the horizontal axis unless you set column
or column-reverse
in the flex-direction
property. We'll provide our explanation based on the default flex-direction
setting.
flex-start
This is the default setting. With this property value, flex items are laid out from the left edge.
Note: 'edge' means the endpoint with some distance from the edge of the element based on the container's paddings and flex item's margins.
![justify-content: flex-start justify-content: flex-start](https://static.d-libro.com/01-course-content-images/1011-10-HTML-CSS-Introduction/020-image-insert/justify-content-flex-start-id101110150510-img01.webp)
center
With this property value, flex items are laid out in the center of the parent element.
Subscribe now for
uninterrupted access.