【发布时间】:2013-11-04 05:20:22
【问题描述】:
我有 Firefox 25.0,我的 div 没有得到正确的高度。
在我的 CSS 中:
#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/
【问题讨论】: