页脚的位置是常量

时间:2010-04-26 00:06:28

标签: html css

如何在主要内容之后将我的页脚放在容器的底部?

这是网站:(在主页上很好,但不在其他任何网站上) http://dl.dropbox.com/u/122695/ds/index.html

6 个答案:

答案 0 :(得分:1)

这解决了你的问题吗?

.footer { clear:both !important;}

答案 1 :(得分:1)

从.panels h6移除高度:200px。 IT应该适合你。

答案 2 :(得分:1)

您的布局有一些问题。你必须首先摆脱固定的高度或尽可能地增加它们。以下是存在问题的规则:

.panels h6 {
  border-left: 1px dotted;
  border-top: 1px solid;
  font-family: verdana;
  font-size: 11px;
  height: 200px;
  /* height 200 px is less than the required height which should be ~244px */
  line-height: 1.3;
  padding: 10px;
}

下一步是可选的,但建议防止进一步的问题:在包含多个浮动元素的所有元素中,在所有浮动元素之后添加以下内容:

<div style="clear: both;"></div>

这将自动设置该元素的高度。

编辑----

设置.panels h6 { height: 200px; overflow-y: scroll; ... }。然后使用JavaScript获取并设置所有三列的高度等于最高列的高度。您可以使用PrototypeElement.getHeight( )Element.setStyle( )功能来执行此操作。

或者,谷歌“CSS Faux Columns”或“CSS Equal Height Columns”。

答案 3 :(得分:0)

您要找的是一个粘性页脚。谷歌为它,你会发现一堆不同的选择。这就是我使用的link text

答案 4 :(得分:0)

在主div上使用clearfix

答案 5 :(得分:0)

我在

之前使用sticky footer来解决这个问题