<html><head><title>布局</title><style type="text/css">body{margin:0;padding:0}.top{height:100px;background:blue}.head{height:100px;wideth:800px;background:#ddd;margin:0 auto}.main{width:800px;height:600px;background:#900;margin:0 auto}.left{width:200px;height:600px;background:#ccc;float:left}.right{width:600px;height:600px;;background:#ddd;float:left}.sub_l{width:400px;height:600px;background:green;float:left}.sub_r{width:200px;height:600px;background:#ccc;float:right}.foot{width:800px;height:100px;background:blue;margin:0 auto}</style></head><body><div class="top"><div class="head"></div></div><div class="main"><div class="left"></div><div class="right"><div class="sub_l"></div><div class="sub_r"></div></div><div class="foot"></div></body></html>
1 回答
已采納

qq_大寒_2
TA貢獻(xiàn)173條經(jīng)驗(yàn) 獲得超185個(gè)贊
.head{height:100px;wideth:800px;background:#ddd;margin:0?auto}
有個(gè)小錯(cuò)誤。,width寫(xiě)成wideth了。
<body> <div?class="top"> <div?class="head"></div> </div> <div?class="main"> <div?class="left"></div> <div?class="right"> <div?class="sub_l"></div> <div?class="sub_r"></div> </div> </div><!--這里少了個(gè)</div>標(biāo)簽--> <div?class="foot"></div> </body>
添加回答
舉報(bào)
0/150
提交
取消