1

我有这个架构:

<div id="container">

    <div id="content">some text</div>

    <footer> my footer things </footer>

</div>

和我的CSS:

body {
    font-family:'Open Sans', sans-serif;
    background:url(../imagens/fundo_cima.jpg) top center no-repeat;
    background-color: #bac8e3;
    color:#000;
    font-size:12px;
    height:100%;    
}

#container{
    width:100%;
    min-height:100%;
}

#content{
    width:990px;
    min-height:526px;
    margin:0 auto;  
}

footer{
    position: absolute;
    bottom:0;
    width:100%;
    height:231px;
    background:url(../imagens/fundo_baixo.jpg) center no-repeat;
}

我的问题:在小分辨率(1024x768)下,页脚悬停在contentdiv 上,而在大分辨率下,这很好用......我需要设置什么?

4

2 回答 2

0

使用本教程/代码我很幸运。http://ryanfait.com/resources/footer-stick-to-bottom-of-page/

于 2012-06-22T14:00:54.710 回答
0

您可能希望在#contentdiv 上放置一个边距,以便为页脚腾出空间。

#content{
    width:990px;
    min-height:526px;
    margin:0 auto 231px auto;  
}

像页脚这样的绝对定位元素自然会悬停在其余内容上。如果要避免这种影响,最简单的方法是通过 padding 或 margin 让其他元素为它们留出空间。

于 2012-06-22T14:04:21.940 回答