强制页脚到页面底部

时间:2014-09-26 20:34:36

标签: php css footer

我尝试过多种方法让我的页脚完全失效,但无济于事。我正在寻找一种将图像,超链接和文本放入页脚的方法(因为我无法发布图像,因为这是一个新的stackoverflow,这是我需要的图像的链接页脚 - http://liep2vsk.edu.lv/footer.png)。该网站的网页具有各种垂直长度,但我需要页脚始终保持不动而不滚动。

我想将页脚外包到一个单独的footer.php文件中,并通过include函数将其链接到一个网页。

我已尝试使用页脚封装程序,但它似乎无法正常工作 - http://liep2vsk.edu.lv/footer.php。我提到我需要它居中吗?

P.S。我是新来的,我知道我的网站代码并不干净,因为有很多AP Div。试着学习一些CSS基础知识。

2 个答案:

答案 0 :(得分:0)

试试这个:http://jsfiddle.net/ubb3psmp/

<style>
.fixedFooter{
position:fixed;
bottom:0;
}
</style>

<div class="fixedFooter">
Something in footer!
</div>

答案 1 :(得分:0)

<body style="position:absolute;height:100%">
  <div id="container" style="min-height:90%"></div>
  <div id="footer" style="position:fixed;margin-bottom:0px">
     <div id="apDiv1"><img src="ico/mail_1.png" width="256" height="256"></div>
     <div id="apDiv2">Some text</div>
  </div>
</body>