2016-08-02 53 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请不要使用这个答案! –

相关问题