2010-01-13 53 views
2

使用什麼HTML/CSS創建一個填充瀏覽器底部並在用戶滾動時保持原位的欄?請參閱envato.com瞭解我在說什麼。如何在持久性瀏覽器底部創建一個欄?

+0

前問搜索。重複:http://stackoverflow.com/questions/42294/how-do-you-get-the-footer-to-stay-at-the-bottom-of-a-web-page – 2010-01-13 16:59:27

+0

我做了搜索,也許我我只是'搜索挑戰',但我只找到確保頁面沒有填滿整個屏幕時頁腳停留在底部的事情。下次我會更勤奮。 – 86Stang 2010-01-13 19:02:48

回答

2

我以前使用過這個方法,它似乎工作得很好。

http://ryanfait.com/sticky-footer/

* { 
    margin: 0; 
} 
html, body { 
    height: 100%; 
} 
.wrapper { 
    min-height: 100%; 
    height: auto !important; 
    height: 100%; 
    margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */ 
} 
.footer, .push { 
    height: 142px; /* .push must be the same height as .footer */ 
} 
+0

太棒了!像魅力一樣工作! – 86Stang 2010-01-13 18:56:58

+0

優秀。我很高興你有一切工作。 – 2010-01-13 19:26:53