CSS绝对定位问题
<!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=gb2312" />
<title>div 3列布局</title>
<style type="text/css">
body {
margin:0px;
padding:0px;
}
#left {
width:100px;
height:300px;
position:absolute;
left:0px;
top:0px;
float:left; // 问题 绝对定位不是脱离标准流了,怎么还要,左飘。。
background-color:#cccccc;
border:1px solid #ffffff;
}
#right {
width:100px;
height:300px;
position:absolute;
top:0px;
right:0px;
background-color:#cccccc;
border:1px solid #ffffff;
}
#middle {
margin-left:103px;
margin-right:103px;
height:300px;
background-color:#336699;
border:1px solid #f00;
color:#ffffff;
}
</style>
</head>
<body>
<div id="left">左边</div>
<div id="right">右边</div>
<div id="middle">中间</div>
</body>
</html>
float:left; // 问题 绝对定位不是脱离标准流了,怎么还要,左飘。。
:) :) :)
[[i] 本帖最后由 winglong 于 2011-10-8 08:27 编辑 [/i]] 我试了一下,去掉float:left效果是一样的 那是因为你设置的left:0;导致的,你修改下left的值看看呢……:D
页:
[1]