div+css绝对居中问题!!请不吝赐教!!
index.html代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Pink Doll</title>
<LINK
href="css.css" type=text/css rel=stylesheet>
</head>
<body>
<div id="dw">
<div class="aa">aaa</div>
<div class="bb">aaa</div>
<div class="cc">aaa</div>
</div>
</body>
</html>
css.css代码:
#dw
{
width: 300px;
height: 200px;
margin-top:0px ;
margin-left :0px;
margin-bottom :0px;
margin-right:0px;
}
.aa
{
margin-top:0px ;
margin-left :0px;
width: 100px;
height: 200px;
background-color: #000000;
}
.bb
{
margin-top:-200px ;
margin-left :100px;
width: 100px;
height: 200px;
background-color: #999999;
}
.cc
{
margin-top:-200px ;
margin-left :200px;
width: 100px;
height: 200px;
background-color: #666666;
}
可不能绝对居中,不知道为什么?请知道的指教!!
退一步,就算不能绝对居中,能居中就好!!!
但谁要是知道绝对居中那是最好!!!
[[it] 本帖最后由 xinzheng 于 2008-6-12 18:03 编辑 [/it]]