注册 登录
编程论坛 ASP技术论坛

求助:asp+css做的主页两模块之间的距离错乱

枫寻翼 发布于 2012-02-01 11:17, 401 次点击
只有本站会员才能查看附件,请 登录
程序代码:
<!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>asdasdasda</title>
<link rel="stylesheet" type="text/css" href="style/1.css" />
</head>
<body>
<!-- #include file="header.asp"-->
<div id="sidebar">
    <h1>新进会员    </h1>
    <div>
      
    </div>
</div>
<div id="content">
    <h1>文章列表 </h1>
    <div>
      
    </div>   
</div>
<div id="sidebar">
    <h1>最新图片    </h1>
    <div>
      
    </div>
</div>
<!--#include file="footer.asp"-->

</body>
</html>*{
    margin:0;
    padding:0;
}
body{
    font-size:12px;
    color:#333;
    width:900px;
    margin:0 auto;
    position:relative;
}
ul{
    list-style-type:none;
}
img{
    border:none;   
}
#header{
    width:900px;
    height:200px;
    background    :url(../iamges/logo.jpg) no-repeat 30px 30px;
    border:1px solid #ccc;
    margin-bottom:10px;
}
#header ul {
    margin-top:160px;
    margin-left:auto;
    width:430px;
}
#header ul li {
    float:left;
    width:70px;
    height:30px;
}
#header ul li a {
    color:#333;
    text-decoration:none;
}
#sidebar{
    width:300px;
    height:550px;
    float:left;
}
#sidebar h1{
    background:#ccc;
    height:25px;
    line-height:25px;
    font-size:14px;
    text-indent:10px;
}
#sidebar div{
    border-left:1px solid #ccc;
    border-right:1px solid #ccc;
    border-bottom:1px solid #ccc;
    height:250px;
}
#content{
    width:580px;
    height:600px;
    float:right;
}
#content h1{
    background:#ccc;
    height:25px;
    line-height:25px;
    font-size:14px;
    text-indent:10px;
    padding-bottom:15px
}
#content div{
    border-left:1px solid #ccc;
    border-right:1px solid #ccc;
    border-bottom:1px solid #ccc;
    height:550px;
}
#footer{
    width:900px;
    height:60px;
    clear:both;
    border-top:1px solid #999;
}
#footer p{
    text-align:center;
    padding-top:10px;
}

只有本站会员才能查看附件,请 登录
在我的电脑上运行后左边的两个块距离好大。没法该怎么修改控制?
3 回复
#2
枫寻翼2012-02-01 16:44
肿么没人呀。。
#3
lh4607952012-02-06 16:05
没仔细看代码 估计是html布局没有 写规范 右边的文章列表高度超过 导致的
#4
yms1232012-02-06 17:45
LZ这个布局应该是先左右后上下的布局,你写的那个代码不是这么布局的
1