日期:2014-05-17  浏览次数:20575 次

实现DIV居中问题
这是我用PS制作的DIV
我把<div id=*>那部分加图片的去掉了``
换成#***{background-images url:(*)
 
这个是没问题的
 
可是我想让它 整个DIV都垂直居中,好象在DIV中不叫垂直居中,额``就象百度的首页那样,在网页的中间显示,,
试了很多方法都```
该怎么弄???


附件地址
提取码:6405fce5

因为这里我上传不了附件,所以传到QQ中转站了 ```

------解决方案--------------------
<!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>
<title>仙剑奇侠传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<style type="text/css">
<!--
body{
text-align:center;
}
#contain{
margin:0 auto;

}
#tupian{width:1002px;height:768px;
background:url('images/bj.gif') no-repeat center;
}
</style>
</head>
<body>
<div id="contain">
<div id="tupian">
</div>
</div>
</body>