Like many people before me, I want to move the last child in a flex box to the flex box end.
I already found the answer to my question. Solution using margin: auto
:
.container {
width: 100%;
display: flex;
justify-content: flex-start;
}
.last-child {
// justify-self: flex-end; why does this not work?
margin-left: auto;
}
But I would like to know why justify-self
does not work like that? Margin: auto
feels like a hack to me. Is there no flex-box way to solve this? Does justify-self
not work like justify-content
but rather justify-item
on a container level?
Thank you for your support!