【问题标题】:make css footer stay under content使css页脚停留在内容下
【发布时间】:2013-10-10 18:17:32
【问题描述】:

我有这个 CSS:

.lh_container {
    width:960px;
    margin:0 auto 40px auto;
    position:relative;
}

.lh_footer {
    position:absolute;
    bottom:0;
    width:100%;
    height:60px;            /* Height of the footer */
    background:#6cf;
}

.lh_footer-container {
    display:block;
    width:80%;
    margin: 0 auto;
    overflow: hidden;
}

还有这个 HTML:

<div class="lh_container">

<div class="lh_footer">
    <div class="lh_footer-container">

    <div class="lh_footer_text">
    &copy; Copyright <?php echo date("Y"); ?>
    </div>

    </div>
</div>

</div><!-- container -->

但页脚不会停留在页面底部 - 我该如何实现?

【问题讨论】:

标签: html css


【解决方案1】:

使用fixed 而不是absolute

http://jsfiddle.net/pnLyh/

【讨论】:

    猜你喜欢
    • 2022-08-24
    • 1970-01-01
    • 2018-04-13
    • 2013-08-02
    • 1970-01-01
    • 1970-01-01
    • 2021-10-05
    • 2014-03-10
    • 1970-01-01
    相关资源
    最近更新 更多