Recently, I was searching for the difference between the "align-content" and "align-items" property of flexbox.
I came across this answer on StakeOverflow.
Now it says two things, that I can't understand:
- The "align-items" property is similar to the "justify-content" property of flexbox but on the perpendicular axis.
- the "align-content" only works on multi-line flexbox.
So... My question is, if the "align-items" property is similar to the "justify-content" then why it don't accept all the values that the "justify-content" property accepts. such as "space-around" or "space-evenly"?
And the second problem is, the "align-content" is also working for single line flexbox. Look:
.cont{
height:150px;
border: 2px solid red;
display: flex;
gap: 20px;
flex-wrap: wrap;
resize: both;
overflow: scroll;
align-content: flex-end;
/* align-items: flex-end; */
}
.items{
background-color: rgb(203, 151, 83);
width: 50px;
height: 50px;
text-align: center;
}
<body>
<div class="cont">
<div class="items">1</div>
<div class="items">2</div>
<div class="items">3</div>
<div class="items">4</div>
<div class="items">5</div>
</div>
</body>
And I'm not randomly asking this question, I first read all the answers and comments on that question and also commented on it about this but no one replied.