2011-02-18 110 views
0

我做的網站,有我有3個的DIV,IE6 BUG,CSS,絕對位置和高度的100%內DIV

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

而現在,格 '內' 是寬度和高度 - 汽車,位置絕對; '內容'有寬度: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,IE8歌劇<一切正常,但在IE6和IE7的div '滾動' 太長,身高:100%不起作用。 You can see it on the picture

有人有想法嗎?請幫我:)

+0

有沒有可能提供鏈接到實時頁面的機會?這使得它更容易(在我看來)追蹤IE6錯誤。關於IE6的主題 - 你確定你仍然關心這個古老的瀏覽器嗎? – thirtydot 2011-02-18 22:43:28

+0

明天我會提供一個活頁面的鏈接,現在我沒有密碼等服務器...更重要的是IE7 - 同樣的錯誤如何IE6 – esen 2011-02-18 22:52:53

回答

-1

爲100%在IE中的高度,你需要將它添加到你的CSS。

* html #content{ 
height:100%; 
} 
1

IE7也有這個bug。

我能找到的唯一解決方法是將#content-element也設置爲position:absolute

-1

我不太確定,但我想也許使用「繼承」爲高度屬性解決了問題。