美文网首页
如何使得页脚始终在屏幕下方

如何使得页脚始终在屏幕下方

作者: 白小爱 | 来源:发表于2015-10-26 15:40 被阅读0次

html结构
<pre>
<div class="container">
//主要内容写在这里
<div class="inner-footer"></div> //这里不写任何内容
</div>
<div class="footer">这里是footer部分</div>
</pre>
css结构
<pre>

  • {
    margin: 0;
    padding: 0
    }
    html, body {
    height: 100%;
    }
    .container {
    clear: both;
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin-bottom: -54px;
    }
    .container .inner-footer {
    height: 54px;
    }
    .footer {
    clear: both;
    position: relative;
    height: 54px;
    text-align: center;
    }
    </pre>

相关文章

网友评论

      本文标题:如何使得页脚始终在屏幕下方

      本文链接:https://www.haomeiwen.com/subject/farxhttx.html