CSS图片宽高不固定的垂直居中方法
<style>
body{padding:0;margin:0;position:absolute;height:100%;100%;}
.demo{display:table;100%;height:100%;}
.demo p{display:table-cell;vertical-align:middle;}
.demo p img{100%;}
</style>
</head>
<body>
<div class="demo">
<p><img src="1.jpg"></p>
</div>
</body>
原文地址链接:http://www.daqianduan.com/2733.html