页面扩展时,页脚需要始终位于底部

时间:2013-04-15 06:13:33

标签: asp.net css

这是我的Aspx代码和页脚需要始终在底部,而页面是扩展

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   中,                                                                                                                                           中,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    请耐心等待...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         >由FFReporting提供支持"的CssClass ="页脚"                                     字体-斜体="假"字体-粗体="假"字体尺寸=" X - 小"前景色="#000">                                                                                                                                                                                       
            

这是css文件

.wrapper
{
    min-height: 99%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -15px;  /* ;the bottom margin is the negative value of the footer's height */
    padding: 0;
}
.footer, .push
{
    height: 16px; /* .push must be the same height as .footer */
    clear: both;
    text-align: center;
    /*font: 10px Verdana, Arial;*/
    font: 10px Arial;
    background: url("../Images/invida_06.jpg") repeat-x;
    /*background-color: #497097;*/
    color: White !important;
}

我需要底线总是在底部,当页面信息较少时,但是当页面显示更多数据时,它总是在所有数据后打印

我尝试了本网站的所有内容,但直到找不到解决方案。 帮帮我!!!

2 个答案:

答案 0 :(得分:2)

This technique始终有效,它被称为粘性页脚

答案 1 :(得分:1)

现在习惯了这段代码

这是示例css代码

html, body {height: 100%;}

#wrap {min-height: 100%;background:red;}

#main {overflow:auto;
padding-bottom: 180px;}  /* must be same height as the footer */
#footer {position: relative;background:green;
margin-top: -180px; /* negative value of footer height */
        height: 180px;
        clear:both;} 

<强> HTML

<div id="wrap">

    <div id="main">

    </div>

</div>

<div id="footer">

</div>

<强> Live Demo