I'm trying to center an image which is contained in a div with display set to table. In it, I wish to display an image, which should be positioned in the center, both vertically and horizontally. I have achieved the horizontal position using margin:auto and setting it as display: table-cell, but it doesn't center it vertically. Any help would be great
.overlay { height: 50%; background: red;position: fixed;
top: 0;
left: 0;
height: 50%;
width: 100%;
display: table;}
.swipe {height: 80px;
display: table-cell;
margin: auto;}
<div style="height:300px">
<div class="overlay">
<img class="swipe" src="https://d30y9cdsu7xlg0.cloudfront.net/png/255751-200.png" />