0

私はウェブサイトをやっていて、そこには3つのDIVがあります。

<div id="inner">
    <div id="content" >
             <div id="scroll" >
             </div>
    </div>
</div>

そして今、div 'inner' は幅と高さです - 自動、絶対位置。「コンテンツ」の幅は 100% です。高さ:100%; そして、「スクロール」は幅です: 96%; パディング:2%; 高さ: 96%; オーバーフロー: 自動;

html, body {width:100%; height:100%; margin:0; padding:0; border:0 none;}
#scroll
{
    width: 96%;
    padding:2%;
    height: 96%;
    overflow: auto;
}

#content {
    width:100%;
    height:100%;
    overflow:hidden;
    line-height:18px;
    }

#inner { 
    position:absolute;
    background:none;
    width:auto;
    height:auto;
    top:40px;
    bottom:85px;
    right:10px;
    left:300px;
}

Firefox、Opera IE8 ではすべて問題ありませんが、IE6 と IE7 では div 'scroll' が長すぎて、height:100% が機能しません。写真で見ることができます:

誰にもアイデアがありますか?私を助けてください :)

4

3 に答える 3

1

IE7 has this bug too.

The only workaround i could found is, set the #content-element also to position:absolute.

于 2011-07-19T11:29:28.587 に答える
-1

よくわかりませんが、高さプロパティに「継承」を使用すると問題が解決するのではないかと思います。

于 2013-01-27T07:13:57.837 に答える
-1

IE で高さを 100% にするには、これを CSS に追加する必要があります。

* html #content{
height:100%;
}
于 2011-02-19T01:42:27.350 に答える