由于近期在学习DIV+CSS布局,在学习中的笔记发上来 ,不好的也别找我算账 一个垃圾布局做为载头吧 HTML: <!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> <link href="sty.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="left"> <div id="y1">163</div> <div id="y2"> <div id="y21"></div> <div id="y22"></div> <div id="foot"></div> </div> </div> <div id="right"></div> </body> </html> 代码: #y1 { background-color: #ff6600; width: 100%; border-top-width: 6px; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; border-top-color: #000088; height: 150px; margin:0px auto; } #y2 { width: 100%; margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; } #y21 { width: 180px; background-color: #009966; height: 350px; float: left; } #y22 { background-color: #9900CC; height: 300px float: left; height: 350px; } #right { float: left; background-color: #005500; height: 600px; width: 18%; } #left { width: 80%; float: left; background-color: #BBBBBB; } #foot { height: 150px; background-color: #FF9900; width: 100%; } body { color: #222222; background-color: #97CF00; }