2010-01-13 88 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

相关问题