It’s very confusing. I saw some stackoverflow answers, but I didn’t quite get it.
They used a lot of complicated terminology.
Thank you in advance!
The easiest way to learn what those properties do is to just try it out with a simple example, but summed up:
-
justify-content
is set on the container and distributes the elements along the main axis (forflex-direction:row
, that is the horizontal axis) -
align-items
is also set on the container and distributes the elements along the cross axis (forflex-direction:row
, that is the vertical axis) -
justify-items
has no effect on a flex-container, it’s used to distribute the elements in agrid
container along the main axis within their cells -
align-content
only applies when a flex-container has multiple rows (whenflex-wrap
is set towrap
), and defines how the rows of elements are distributed along the cross-axis
2 Likes
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.