center something with css not using flex
This is how you can center something in another element if you dont want to use the flex method.
You will need the relative position on the outer element, and the absolute on the center one unless you want it to be centered across the whole screen.
CSS
.center {
top : 50%;
left : 50%;
transform : translate(-50%,-50%);
position:absolute;
}
.center-test-wrap {
position:relative;
width:400px;
height:400px;
border-radius:5px;
background:teal;
color:#FFF;
}
HTML
<div class='center-test-wrap'>
<div class='center'>
This should be in the center.
</div>
</div>
This should be in the center.