2012-08-01 154 views

回答

0

如果你指的是具有固定的页脚会始终显示在底部,你将需要使用固定位置bottom: 0px因此会一直呆在那里,即使内容未填满屏幕

#footer_id { 
     position:fixed; 
     bottom:0px; 
     height: "whatever"; 
    } 
+0

我不认为OP是指这一点。在链接的网页上,页脚需要保留在所有内容之下。 – irrelephant 2012-08-01 02:29:14

0

是啊,你可以使用粘性页脚

 <div id="footer"></div> 

#footer 
     { 
     position: relative; 
     margin-top: -50px; /* Give the height of footer as negative margin */ 
     height: 50px; 
     clear:both; 
     } 

此链接可以帮助你

http://www.cssstickyfooter.com/using-sticky-footer-code.html

+0

不,我不是在说那个。看,像页脚是低于内容,所以它总是在底部。但是,当内容较少时,它仍然是内容的底部,而不是屏幕的底部。我希望它在屏幕的底部 – 2012-08-01 13:09:49

+0

它没有工作。 – 2012-08-01 13:14:12

+0

这只是粘脚页脚 – Prashobh 2012-08-01 13:24:44