clare485
9/1/2014 - 1:51 PM

align_block_center_middle

Align a block in center and middle
The often solution to this problem is to put a block into 50% position horizontally and vertically with top and left properties and then shift it back with negative margins. However there is more accurate and less known trick.

{
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: auto;
}