右側先加載,左側后加載,應該說的是下方div方框為right在上方,left在下方,這樣當瀏覽器閱讀的時候,會先讀到right,這個時候添加浮動,則不能都添加左浮動。需要將right添加為右浮動,left添加為左浮動。當right屬性添加為右浮動的時候,盒子邊框先右浮動觸碰到main右邊框,然后停止浮動;left屬性添加為左浮動的時候,盒子邊框觸碰到main左邊框,然后停止浮動。這個情況兩個盒子是left在左,right在右,而瀏覽器閱讀順序為先出現right盒子,然后浮動觸碰main右邊框;然后出現left盒子,浮動觸碰main左邊框。
.top{width:100%;height:100px;background:#ccc;}
.main{width:100%;height:500px;background:red;}
.left{width:200px;height:500px;background:blue;position:absolute;left:0;top:100px;}
.right{margin-left:210px;height:500px;background:#3f6;left:0;top:100;}
.foot{width:100%;height:70px;background:#F60;}
.main{width:100%;height:500px;background:red;}
.left{width:200px;height:500px;background:blue;position:absolute;left:0;top:100px;}
.right{margin-left:210px;height:500px;background:#3f6;left:0;top:100;}
.foot{width:100%;height:70px;background:#F60;}