2012-06-06 72 views
1

我遇到了在Firefox中的最小高度問題,我試圖把它放在100%,但它不工作。在Chrome中,它完美的工作。在Firefox中的最小高度不工作

我的代碼是:

<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。

有人可以幫我嗎?

感謝

回答

1

,如果你只是想保持底部的頁腳,你可以使用

.footer{ 
position:fixed; /*or absolute, or whatever*/ 
bottom:0px; 
height: 55px; 
} 
+0

它的工作!我不知道我怎麼之前沒去想它。 謝謝! –