margin: auto
is an alternative to
justify-content: center
and
align-items: center
. Instead of this code on the flex container:
.container {
    justify-content: center;
    align-items: center;
}
We can use
margin: auto
the flex item:
.container div {
    margin: auto;
}
(when there is only one flex item)
by Valeri Tandilashvili
4 years ago
CSS
properties
Flexbox Tutorial (CSS): Real Layout Examples
1
Pro tip: use ```triple backticks around text``` to write in code fences