Consider this snippet.
.parent {
display: flex;
justify-content: center;
align-items: center;
}
.child {
margin-left: auto;
}
Why does the child not stay centered, and what is the simplest fix.
Ellen ![]()
Consider this snippet.
.parent {
display: flex;
justify-content: center;
align-items: center;
}
.child {
margin-left: auto;
}
Why does the child not stay centered, and what is the simplest fix.
Ellen ![]()
margin-left: auto wins by eating the free space, so it pushes the child away from the flex centering.
Arthur
:: Copyright KIRUPA 2024 //--