2
這裏是我的代碼,減少到相關部分:爲什麼在給定寬度= 100%的情況下,div和表的行爲有所不同?
<html><head><title></title>
<style type="text/css">
body { background-color: #fff; }
#titlebar{ border: solid 1px black; margin:10px; }
#bodyWrapper{ float: left; width: 100%; }
#bodyColumn{ margin-left: 230px; height:500px; }
#menuColumn{
float: left;
width: 230px;
border: solid 1px black;
margin-left: -100%;
height:500px;
}
.bigContent{ width: 100%; margin:10px; }
.section{
border: 1px solid black;
padding:10px;
overflow: auto;
}
</style></head><body>
<div id="titlebar">Title</div>
<div id="bodyWrapper"><div id="bodyColumn">
<table class="section bigContent"><tr><td>FIRST</td></table></table>
<div class="section bigContent">SECOND</div>
</div></div>
<div id="menuColumn">MENU</div>
</body></html>
我的問題:
- 的
<div>
含有「第二」是不是包含「FIRST」的<table>
更寬雖然兩者都是兄弟姐妹和有width=100%
通過相同的CSS類 <div>
也比屏幕更寬,導致滾動條出現
這是爲什麼,我能做些什麼來解決它?
注:我看到在這兩個火狐3.6和IE 8
這並不能解釋爲什麼``
相關問題