2013-11-03 82 views
0

我有Firefox 25.0,我的div沒有得到正確的高度。 在我的CSS:高度在Firefox中不起作用

#page { 
    background-color: rgba(255,255,255,0.9); 
    width: 98%; 
    height: 87%; 
    position: absolute; 
    left: 1%; 
    top: 12%; 
    display: table; 
    padding-bottom: 1px; 
} 

當窗口過小,高度超過87%

我已經嘗試了jQuery的選擇:

$(document).ready(function() { 
    var contentheight = $("#most").height(); 
    var contentheightt = contentheight * .87; 
    contentheightt = contentheightt+"px"; 
    $("#page").css("height",contentheightt); 
}); 

在Firefox無論是工作,但它在Safari和Chrome。

這裏是我的網頁:http://sdgr.comule.com/sd/

回答

0

對於Firefox中,你需要在你的#page.txt類添加以下CSS -

position: absolute; 
overflow-y: scroll; 
left: 500px; 

變化左值按要求。

+0

謝謝你的幫助。添加這些少數幾個可以讓我用jQuery修改高度出於某種原因。 –

0

在百分比CSS高度工作不正常 嘗試使用最小高度不百分比 你也可以在jQuery的 嘗試$(窗口).height() Greetings

0

#page div隨內部div展開,其中包含您的內容。如果您將以下div設置爲position: absolute;,則應解決問題。

<div id="desc" class="col txt"></div>