2011-03-12 80 views
1

我有一個頁眉,左導航和右內容部分的佈局。當正確的內容太寬而無法放入父容器(div)時,我希望內容能夠向右溢出div。正如我所願,它在現代瀏覽器中工作,但IE6阻止溢出,並隨後將左側導航強制在正確的內容下面。有什麼建議麼?IE6 - 如何溢出除div外的div內容

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html> 
    <body> 
     <div id="container" style="width:984px;margin:0 auto;"> 
      <div id="header" style="height:76px;background-color:#69B8E1">Site Header</div> 
      <div id="contentWrapper" style="float:right;margin-left:-175px;width:100%"> 
       <div id="rightContent" style="margin-left:165px;background-color:#C6DDDF;"> 
        <table> 
         <tr> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
          <th> 
           Very lengthy description</th> 
         </tr> 
        </table> 
       </div> 
      </div> 
      <div id="leftMenu" style="float:left;width:150px;background-color:#C4DF9B">Left 
       Menu</div> 
     </div> 
    </body> 
</html> 
+0

tryed http://www.webtoolkit.info/css-clearfix.html ? – yoda 2011-03-12 19:01:08

回答

2

更新:

<div id="contentWrapper" style="position:relative;float:right;margin-left:-175px;width:100%"> 
<div id="rightContent" style="position:absolute;top:0;left:0;margin-left:165px;background-color:#C6DDDF;"> 
+0

感謝您的意見。不幸的是,這是我正在調整的網站的現有佈局。我沒有選擇修改div的位置(即rightortent和leftmenu必須保持爲兄弟姐妹,依次)。 – Jeremy 2011-03-12 19:32:31

+0

查看我的更新。 – 2011-03-12 19:41:10

+0

雖然(在IE6中)切斷了右側的內容。 – Jeremy 2011-03-12 19:49:10