2016-08-02 78 views
-1

我有一個網站,我需要爲所有頁面設置一個通用頁腳。然而,頁面內容各不相同,少數頁面具有較少的主體,很少有可滾動的主體。但是我的頁腳並沒有在所有頁面上保持不變。我需要它在所有頁面的底部(在主體之後)。我嘗試了多種使用CSS,javascript,jquery的方式,但它們僅適用於一頁而不是全部。所有網頁的常見頁腳

有人可以幫我解決這個問題。

+1

身體後?爲什麼? –

+2

[你如何讓頁腳停留在網頁底部?](http://stackoverflow.com/questions/42294/how-do-you-get-the-footer-to-stay在網頁底部) – APAD1

+0

服務器端包括也許? –

回答

0

我也一直在努力!我已經學會了,關鍵是要有一個包裝ID:

HTML:

<html> 

<body> 
<div id="wrapper"> 


<div class="content"> 

<p> This is the content! </p> 

</div> <!-- content --> 



<footer> 

<p> This is the footer!!! </p> 

</footer> 

<div> <!--#wrapper--> 

</body> 

</html> 

CSS:

html { 
height:100%; 
} 


body { 
height:100%; 
} 

#wrapper{ 
min-height:100%; 
position: relative; 
} 

footer{ 
position:absolute; 
bottom:0px; 
background-color: black; 
color: white; 
width:100%; 
padding-top: 25px; 
padding-bottom: 25px; 
text-align:center; 

} 
+0

@Sri請不要使用這個答案! –

相關問題