Position center by height
.parent {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.parent {
height: 100vh;
max-height: 100%;
&:after {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
.element {
display: inline-block;
vertical-align: middle;
}
}
.parent {
position: relative;
.element {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
}