求助 DIV浮动排版错误!
代码如下:
<!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>无标题文档</title>
<style type="text/css">
body{ margin:0 auto; font-size:12px; font-family:Verdana; line-height:1.5;}
ul,dl,dd,h1,h2,h3,h4,h5,h6,form,p { padding:0; margin:0;}
ul { list-style:none;}
img {border:0px;}
a {color:#05a; text-decoration:none;}
a:hover { color:#f00;}
.clearfloat {clear:both;height:0;font-size: 1px;line-height: 0px;}
/*body*/
#container { width:900px; margin:0 auto;}
/*header*/
#header { height:70px; background:#ccffcc; margin-bottom:8px;}
#nav { height:30px; background:#ccffcc; margin-bottom:8px;}
/*main*/
#maincontent{margin-bottom:8px; overflow:auto; zoom:1;}
#main { float:left; width:664px; height:500px; background:#ffff99;}
#side { float:right; width:200px; height:500px; background:#ffcc99;}
/*footer*/
#footer { height:70px; background:#ccffcc;}
</style>
</head>
<body>
<div id="container">
<div id="header">此处显示id header内容</div>
<div class="clearfloat"></div>
<div id="nav">此处显示id nav 的内容</div>
<div class="clearfloat"></div>
<div id="maincontent">
<div id="main">此处显示id main的内容</div>
<div class="clearfloat"></div>
<div id="side">此处显示id side的内容</div>
<div class="clearfloat"></div>
</div>
<div id="footer">此处显示id footer的内容</div>
</div>
</body>
</html>
效果如下:
附件: 您所在的用户组无法下载或查看附件