Lyong
.img{
position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
-moz-transform:translate(-50%,-50%);
-webkit-transform:translate(-50%,-50%);
-o-transform:translate(-50%,-50%);
}<div class="myDiv">
<img class="img" src=""/>
</div>.myDiv{
display: -moz-box;
display: -webkit-box;
-moz-box-orient: vertical;
-webkit-box-orient: vertical;
-moz-box-align: center;
-webkit-box-align: center;
-moz-box-pack: center;
-webkit-box-pack: center;
} //兼容性不是很好// ! ie
.myDiv{
display: table-cell;
vertical-align:middle;
text-align:center;
}