Center A Div Vertically and Horizontally

Something I want to do quite often is center a div horizontally and vertically but make it stay center no matter the size of screen it is being displayed on (laptop, mobile, tablet etc.)This can be achieved with a little piece of CSS.

HTML

<div class='loading-content'>
     <h2>Loading</h2>
</div>

CSS

.loading-content {
    position: absolute;
    margin: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 200px;
    height: 50px;
}