2010-09-16 21 views
1

我有一個帶有大div(例如白色)的網頁,另一個div跟在前一個div之後。問題是,如果白色塊足夠大​​,並且它的高度幾乎甚至比瀏覽器窗口大(甚至出現滾動條),紅色塊位於頁面底部,紅色塊和底部塊之間仍有間隙窗口在Firefox/Safari瀏覽器/歌劇: alt text在firefox/opera/Safari中消除最後div和頁面結尾之間的空白

但在資源管理器/瀏覽器一切正常:

alt text

我的代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> 
    <title></title> 
    <style type="text/css"> 
     root { display: block; } 

     html, body{ 
      padding: 0; 
      margin: 0; 
      width: 100%; 
      height: 100%; 
      font-family: Tahoma; 
      background-color: blue ; 
     } 

     #container{ 
      position: absolute; 
      left: 50%; 
      width: 961px; 
      height: 100%; 
      margin-left: -480px; 
     } 


     .infContainer{ 
      position: relative; 
      padding-left: 19px; 
      background-color: white; 
      color: #434343; 
     } 

     div#footerCopyright{ 
      position: relative; 
      bottom: 15px; 
      font-size: 0.75em; 
      background-color: red; 
     } 

     div#bottomFooterDivider{ 
      height: 50px; 
     } 


     div#pageBottomDivider{ 
      height: 35px; 
     } 
    </style> 
</head> 
<body> 
    <div id="container"> 

     <div id="mainBlock" class="infContainer"> 
      <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> 
      <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> 
      <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/> 
      <br/><br/><br/><br/><br/><br/> 
     </div> 


     <div id="footerCopyright"> 
      <div id="bottomFooterDivider"></div> 
     </div> 
    </div> 

</body> 
</html> 

如何解決ŧ他的問題和相同的頁面沒有在Firefox/Opera/Safari的藍色差距。

實際頁: http://109.74.203.141/stack/1/tmp.html

回答

1

footerCopyright格設置爲position: relative; bottom: 15px;

當我設置下爲0,它排隊在FF底部。

相關問題