请帮帮忙 看下代码有点长CSS

来源:百度知道 编辑:UC知道 时间:2024/05/25 18:00:27
CSS文件:

#center{width:490px;
height:300px;
background-color:#23b;
float:left;
margin:0px 5px;
}
#right {width:150px;
height:500px;
background-color:#000;
float:right;
}

/*-----------------------------底部-------------------------*/
#footer{width:800px;
height:140px;
margin-bottom:0px;
background-color:#963;
}

HTML文件:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>巡洋舰网吧</title>
<meta http-equiv="Content-type" content="text/html; setchar=gb2312" />
<link href="css/css.css" rel="stylesheet">
</head>
<body>

应该在#footer中加入clear:both;

在其它DIV里也一样,加了float,最好跟一个clear来清除浮动。
比如:#center{float:left;clear:left;}因为#center左边是不希望再有其它DIV的。

将footer的CSS里加入float:left
==========================================================
#footer{width:800px;
height:140px;
margin-bottom:0px;
background-color:#963;
float:left;
}