css - 页脚 div 没有保持在底部

标签 css

红色页脚出现在中间。如何让它保持在底部?像 clear: bothoverflow: hidden

我尝试了很多东西,我做错了什么吗?

Demo

代码太大,无法粘贴到此处(限制为 30000 个字符)。请给我工作 fiddle 。

更新:现在可以使用了。

#footer {
  position: relative;
  height: 274px
  bottom: 0;
  margin-top: 274px;
}

最佳答案

你有

#footer {
    margin:-274px 0 0;
}

这是给它一个负的上边距并向上移动页脚。尝试删除该行。尽管您可能还需要调整页面的内容。您应该对内容使用 clearfix,这样它就不会落在页脚后面。

关于css - 页脚 div 没有保持在底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14122231/

相关文章:

IE 中的 HTML、CSS 问题

html - 在菜单中使用 Unicode 字符而不是图形

css - 页面中并排放置 2 个 div

javascript - 如何在iframe内制作固定div

css - 使用 CSS 垂直拆分页面

Javascript 点击元素

javascript - CSS/JS : split words with horizontal line in responsive design

html - 菜单布局中背景颜色的样式在哪里?

jquery - 固定位置问题

css - 有没有更简单的方法来使用 css 创建这个形状? (包括 jsfiddle)