html - 将页脚放在屏幕底部

标签 html css footer sticky-footer

<分区>

Possible Duplicate:
CSS sticky footer

这个问题我已经有一段时间了,问题出在我所有的页脚上。每次我在这段代码语法中放置:

  <Footer>
    <p class="About">DESIGN BY MICHAEL & CODE BY ROKO</p>
  </Footer>

Footer {
display:block;
position: absolute;
bottom: 0;
width: 100%;
height: 141px;
background: url(../assets/content/footer.png) repeat-x left bottom;
}

页脚要么放在底部,但当您滚动时,它会停留在原处并且​​页脚几乎位于页面的一半位置,或者本应位于页脚内的文本位于页面的顶部页面。

谁能帮帮我?我试着查找 Sticky Footer,结果还是一样......

最佳答案

我做了这样的事情并且效果很好:

<div class="footer" id="footer">My Footer</div>

#footer
{
    clear: both;
    border: 1px groove #aaaaaa;
    background: blue;
    color: White;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    line-height: normal;
    margin: 0;
    position: fixed;
    bottom: 0px;
    width: 100%;
}

您可以在此处查看示例:http://jsfiddle.net/RDuWn/

关于html - 将页脚放在屏幕底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7542683/

相关文章:

html - 如何使 div 的高度响应?

javascript - 如何包含另一个页面的 div?

html - CSS Div Box WordPress 主题

iphone - 如何在 splitViewController 中的 RootViewController 中将页脚图像添加到 UITableView

html - 滚动条不适用于纯视差 css

html - 无序列表元素内容器 div 的垂直对齐

html - 如何在不溢出文本且不扩展其他列的宽度的情况下在列标题中显示垂直文本

javascript - 如果调整了一张卡片的大小,请连续调整所有卡片的大小

html - 如何使具有许多 div 结构的网页内容居中

html - 将 2 条 div 线合并为 1