<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<style>
.box{ width:800px;height:600px;border:2px solid #000; text-align:center;}
span{ display:inline-block; height:100%; vertical-align:middle;}
img{ vertical-align:middle;}
</style>
</head>
<body>
<div class="box">
<img src="bigptr.jpg" /><span></span>
</div>
</body>
</html>
兼容ie6,7和标准版本
第二种方法,display:table-cell+text-align:center+vertical-align:top+css hack兼容ie6,7
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<style>
.box{ width:800px; height:600px; border:2px solid #000; display:table; position:relative; overflow:hidden;}
span{ display:table-cell; text-align:center; vertical-align:middle; *position:absolute; left:50%; top:50%;}
img{ *position:relative; vertical-align:top; left:-50%; top:-50%;}
</style>
</head>
<body>
<div class="box">
<span><img src="bigptr.jpg" /></span>
</div>
</body>
</html>