IE6 - 如何溢出div之外的div内容

时间:2011-03-12 18:55:23

标签: css internet-explorer-6

我有一个带有标题,左侧导航和右侧内容部分的布局。当正确的内容太宽而不适合父容器(div)时,我希望内容将div溢出到右边。这在我想要的现代浏览器中工作,但IE6防止溢出,并随后强制左侧导航在正确的内容下面。有什么建议?

<!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>

1 个答案:

答案 0 :(得分: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;">