图片高不固定水平居中css
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图片高不固定水平居中</title>
<style type="text/css">
.box {
display: table-cell; vertical-align:middle; text-align:center; *display: block; *font-family:Arial; *font-size: 262.5px; overflow:hidden; width: 300px; height: 300px; border: #000 solid 1px; }
/*font-size: 262.5px; 高×0.825*/
.box img {
vertical-align:middle;
border:0;
}
</style>
</head>
<body>
<div class="box">
<a href="#" target="_blank"><img src="http://img.bbs.163.com/new/20111012/photo/go/gogo911@vip.163.com/95ea49bc830405a6481faed4ba98b1b8.jpg" width="200" height="200" />
</a>
</div>
<div class="box">
<img src="http://img.bbs.163.com/new/20111012/photo/go/gogo911@vip.163.com/7f94f4d589c952dd6cc267da2d4cb80e.jpg" width="200" height="140" >
</div>
</body>
</html>