我有一个叫做“内容”的div,我希望至少占据整个窗口的高度。最小高度100%不能在内部div上工作
因此,我所做的是:
body
{
min-height:100%;
height:auto !important;
/* The following probably aren't relevant but I'll include them just in case */
min-width:600px;
color: #fff;
font-family:'lucida grande',verdana,helvetica,arial,sans-serif;
font-size:90%;
margin: 0;
}
div#content
{
min-height:100%;
/* The following probably aren't relevant but I'll include them just in case */
clear: both;
color: #333;
padding: 10px 20px 40px 20px;
position:relative;
background:url(/img/strawberry.png) right bottom no-repeat;
}
用Firebug,我核实,确实现在占用了整个页面(甚至当有页面上没有内容就在我想要的。)
然而,问题是,内容并没有占据整个高度,而只是内容的大小。
编辑:似乎工作在铬7.0.517.41,但不是在Firefox 3.6.10(问题似乎发生在所有版本的Firefox 3.6.x和可能以前的版本以及)。
试过了,对ff 3.6.10没有任何影响。 = [ – 2010-10-22 07:30:06
其实nvm它的工作,它是高度:auto!important;那是在杀死它。我想知道为什么它不影响铬。 – 2010-10-22 07:35:11
我知道的唯一的事情是高度计算是非常危险的,这取决于浏览器... =/ – MatTheCat 2010-10-22 07:40:14