html
<div class="box">
<img src="1.png" alt="" />
</div>
css
*{margin:0;padding:0;}
.box{
height:200px;
width:400px;
border:1px solid red;
position:relative;
}
img{
position: absolute;
left:0;right:0;
top:0;bottom: 0;
margin:auto;
}