Centering a Block on a Page with Flexbox

Flexbox is one of the simplest and most elegant ways to center a block on a page. Keep in mind that centering is maintained even when the parent is smaller than the child: the child will overflow and be clipped.

<div class="parent">
    <div class="block">
        <img src="1450829233933958453855" alt=""/>
    </div>
</div>
.parent {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
    overflow: auto;
}

.block {
    background: #60a839;

    img {
        display: block;
        border: none;
    }
}