1

我对 Firefox 的最小高度有疑问,我试图将其设置为 100%,但它不起作用。在 Chrome 中它可以完美运行。

我的代码是:

   <html>
    <head>
        <link rel="stylesheet" type="text/css" media="all" href="../css/main.css"/>
    </head>
    <body>
        <div class="main">
            <div class="header">Here is the header</div>
            <div class="content ">Here is the content</div>
            <div class="footer">Here is the footer</div>
        </div>
    </body>
   </html>

而css文件是

.header {
    height:160px;
}

.content{
    min-height: 100%;
    height: auto !important;
    height: 100%;   
}

.footer{
    margin: -215px auto 0 0; 
    height: 55px;
}

我要做的就是将页脚保持在页面底部,在 Chrome 中它可以工作,但在 Firefox 中它不需要内容的高度。我一直在寻找解决方案,很多人都说要

#page{min-height:100%;} 
html, body{min-height:100%;}

但它是一样的,它仍然适用于chrome,但不适用于firefox。

有人可以帮助我吗?

谢谢

4

1 回答 1

1

如果您只是想将页脚保持在底部,则可以使用

 .footer{
 position:fixed; /*or absolute, or whatever*/
 bottom:0px;
 height: 55px;
 }  
于 2012-06-06T04:09:36.733 回答