2013-04-10 91 views

回答

0

我認爲最好是提到你遇到問題的瀏覽器。例如,我假設你有問題與IE6。我會盡量根據我的假設來回答你的問題。所以如果你想沿着瀏覽器窗口的下邊緣進行固定定位,那麼body和html的100%高度是可以的。

像這樣:

* { margin:0; padding:0; } 
html, body { 
    height: 100%; 
} 
body #fixedElement { 
    position:fixed !important; 
    position: absolute; /*ie6 and above*/ 
    top: 0; 
    right: 0; 
} 
#page-wrap { 
    width: 600px; 
    margin: 0 auto; 
    font: 16px/2 Georgia, Serif; 
} 

希望這個具有涉及CSS

http://css-tricks.com/snippets/css/fixed-positioning-in-ie-6/

問題時,將幫助也請您查看此網站
相關問題