2011-03-12 69 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