如何使用css设置最小高度

时间:2013-12-25 15:29:12

标签: css

伙计们,你能帮我吗?我的网站是http://letsforum.com/,我的内容高度有问题,有时内容不足100%,我的问题是如何设置 .content min-height:100%;

请访问此处的帮助页面并查看 ./ help.php

1 个答案:

答案 0 :(得分:0)

如果你问如何将你的页脚保持在底部,那里有一些技巧。 看看你的404页面,我猜这就是你所说的。

看看这些例子:

http://matthewjamestaylor.com/blog/keeping-footers-at-the-bottom-of-the-page

http://www.cssreset.com/how-to-keep-footer-at-bottom-of-page-with-css/

抱歉,我目前只能发布两个链接。

另一个建议:可能不适用于所有浏览器:

您需要更新HTML文件,以便容器的Closing div实际上在Footer DIV之前(并在下面进行CSS更改)... 例如;

<div id="container">
   <div id="header">
    ....
    ....
   </div>
   <div id="content">
   ....
   ....
   </div>
**</div>** <-- This one was previously below the closing DIV for the footer.
<div id="footer">
....
....
</div>

然后你会更新你的global.css:

html, body {
    height: 100%;
 }

#content {
 background: #fff;
 width: auto !important;
 padding: 20px 10px;
 overflow: auto;  /*change this */
 border-bottom: 1px solid #000;
 padding-bottom: 20px; /* add this */
}


/* Add this footer section */

#footer {
 position: relative;
 margin-top: -20px;
 height: 20px;
 clear:both;
}