#left { background: #eee; width: 350px; height: 400px; float: left; } #right { background: #ccc; width: 150px; height: 400px; float: right; } #maincontainer { width: 500px; overflow: auto; } #foot { background: #eee; width: 500px; height: 100px; }
#foot{
clear:both
}
試試
*{margin:0;padding:0;}
LZ啥瀏覽器?
1樓和2樓的辦法都可以試試
#foot { clear:both; background: #eee; width: 500px; height: 100px; }
測(cè)試了IE7、8、9、10和chrome,在IE7中出現(xiàn)這種現(xiàn)象,正在找解決方式。
需要加上層來(lái)清除浮動(dòng)~~
.clear{clear:both;background: none;border: 0;display: block;float: none;font-size:0;margin:0;padding:0;overflow: hidden;visibility: hidden;width:0px;height:0px;line-height:0px;}#left { background: #eee; width: 350px; height: 400px; float: left; } #right { background: #ccc; width: 150px; height: 400px; float: right; } #maincontainer { width: 500px; overflow: auto; } #foot { background: #eee; width: 500px; height: 100px; }
需要加上 層來(lái)清除浮動(dòng)~~
.clear{clear:both;background: none;border: 0;display: block;float: none;font-size:0;margin:0;padding:0;overflow: hidden;visibility: hidden;width:0px;height:0px;line-height:0px;} #left { background: #eee; width: 350px; height: 400px; float: left; } #right { background: #ccc; width: 150px; height: 400px; float: right; } #maincontainer { width: 500px; overflow: auto; } #foot { background: #eee; width: 500px; height: 100px; }
大家誤會(huì)了 我可能強(qiáng)調(diào)的也不對(duì),這個(gè)是在VS2008的設(shè)計(jì)頁(yè)面中的情況。瀏覽器運(yùn)行是正常的。。
應(yīng)該是上下div邊距的問(wèn)題
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com