关于div布局问题,为什么显示在设计视图与浏览器中的不一样呢?
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!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">
#head {
height: 80px;
width: 1000px;
background-color: #006699;
}
#second {
background-color: #003366;
height: 25px;
width: 1000px;
margin-bottom: 5px;
margin-top: 5px;
}
#1 {
background-color: #0033CC;
float: left;
height: 400px;
width: 200px;
}
#3 {
background-color: #CC0066;
height: 400px;
margin:0 2px;
}
#2 {
background-color: #993300;
float: right;
height: 400px;
width: 200px;
}
#content {
height: 400px;
width: 1000px;
background-color: #FFFFFF;
}
</style>
</head>
<body>
<div id="head">this is head</div>
<div id="second">this is second block</div>
<div id="content">
<div id="1">this is 1</div>
<div id="2">this is 2</div>
<div id="3">this is 3</div>
</div>
<div id="footer">this is head </div>
</body>
</html> 展开
<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">
#head {
height: 80px;
width: 1000px;
background-color: #006699;
}
#second {
background-color: #003366;
height: 25px;
width: 1000px;
margin-bottom: 5px;
margin-top: 5px;
}
#1 {
background-color: #0033CC;
float: left;
height: 400px;
width: 200px;
}
#3 {
background-color: #CC0066;
height: 400px;
margin:0 2px;
}
#2 {
background-color: #993300;
float: right;
height: 400px;
width: 200px;
}
#content {
height: 400px;
width: 1000px;
background-color: #FFFFFF;
}
</style>
</head>
<body>
<div id="head">this is head</div>
<div id="second">this is second block</div>
<div id="content">
<div id="1">this is 1</div>
<div id="2">this is 2</div>
<div id="3">this is 3</div>
</div>
<div id="footer">this is head </div>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询