不确定图片大小让元素水平垂直居中
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
/*
第一种水平居中
求得字体的大小
fontsize = height/1.14;
设置font-size是为了兼容IE 6 7
*/
.main{ display:table-cell;? width:300px; height:300px; font-szie:263px; border:#F00 solid 1px;*background:#CFF !important; vertical-align:middle; text-align:center; overflow:hidden
}
.main img{ vertical-align:middle; text-align:center;}
</style>
</head>
<body>
<div />
</div>
</body>
</html>