If you want to place absolutely positioned elements in the middle of the screen just do the following:

    width: 150px;
    height: 100px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -50px;/* half of the height */
    margin-left: -75px;/* half of the width */

That’s it!

*Note: If you’re dealing with elements that may not have a fixed width or height then you can use jQuery .height() or .width() to get the width and height of the elements. Then divide the values by 2 and apply your margins with those values. More on jQuery .height() and .width().