2013-02-07 24 views
0

我無法弄清楚爲什麼頁腳上的黑色條不會出現在窗口的基線上。 我不希望它在滾動時「固定」。只是在絕對底部基線上的頁腳

html { 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    -o-background-size: cover; 
    background-size: cover; 
    position: relative; 
} 

body { 
    padding-top: 15px; /* 60px to make the container go all the way to the bottom of the topbar */ 
    background: #f7f7f7 repeat-x url(<%=image_path('background.png')%>) top left; 
    font-family: Helvetica, Arial, sans-serif; 
    color: #323232; 
} 

footer{ 
    margin: 0px; 
    padding: 10px; 
    background: black; 
    color: white; 
    position: absolute; 
    left:0; 
    right: 0; 
    bottom: 0; 

} 

enter image description here

+0

請提供html – Ramin

+0

不應該底部屬性和其他人是0px而不是0? – Ramin

回答

1

還有時,我希望有一個頁腳是「粘」,我一直用這個常見問題very solid solution

+0

我嘗試過,但在其他頁面,如果我向下滾動,我得到這個:http://cl.ly/image/2l2I1d0C1i28 – sparkle

+0

然後你做錯了什麼;)請添加你的HTML和CSS,所以我們可以嘗試看看是什麼出錯了。 – Flauwekeul

+0

已解決! :)它是「位置:絕對;」在頁腳 – sparkle