网页的排版

来源:百度知道 编辑:UC知道 时间:2024/06/03 08:00:13
<!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>
<!--
#all
{
width:980px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
#top
{
width:980px;
height:230px;
}
#daohang
{
width:980px;
height:30px;
}
#zuo
{
float:right;
width:250px;
}
#main
{
width:980px;
}

把所有ID的float属性设置为left
另外你的源代码中的高度严重失衡哦,要想达到图片的效果,需要调整一下下
下面是改过的源代码(width与height属性值都没有改),你可以参考一下
<!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>
<!--
#all
{
width:980px;
margin-top: 0px;
margin-right: auto;
margin-bottom: 0px;
margin-left: auto;
}
#top
{
width:980px;
height:230px;
float:left;
}
#daohang
{
width:980px;
height:3