CSS Centering: Align Horizonally and Vertically - Responsive Align Center

Mar
2015
30

A quick and easy solution for centering any div horizontally and vertically

.container {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
Tags: 
Cats: 
this is an arrow pointing back to the top of the page