<div class="wrapper"> <img src="http://placehold.it/150x150" alt="" /> </div>
.wrapper { position: relative; width: 100%; height:300px; border: 1px solid black; } img{ position: absolute; margin: auto; top: 0; left: 0; right: 0; bottom: 0; }