任意图片在div里的垂直居中!

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<style type="text/css"> 
   div{ border:1px solid #ccc; height:500px; width:500px; text-align:center; margin:0 auto; background:#ccc;} 
   img{ vertical-align:middle; } 
   div span{ height:100%; width:0; overflow:hidden; display:inline-block; vertical-align:middle; } 
</style>
<div class="test">
<img src="icon.png"><span> </span>
</div>