css 实现 stick-footer

粘性底部(stick-footer):

 

       屏幕内容不足一屏幕时,footer固定在底部,

       内容超过一屏幕的时候,footer在内容的最下面,滚动到最后在可以看到footer

 

亲测有效!亲测有效!亲测有效!亲测有效!亲测有效!

亲测有效!亲测有效!亲测有效!亲测有效!亲测有效!

亲测有效!亲测有效!亲测有效!亲测有效!亲测有效!

 

CSS 如下:

.box{
        position: relative;
        min-height: 100%;
}
.item{
    line-height: 50px;
    text-align: center;
    font-size: 14px;
    border-bottom: #26a2ff;
}
.footer{
    position:absolute;
    bottom: 50px;
    left: 0;
    width: 100%;
    line-height: 50px;
    background: #26a2ff;
    color: white;
}

 

HTML 如下:

<div class="box">

        <div class="content">
            <ul>
                <li>this is 1</li>
            </ul>
        </div>

        <div class="footer">this is footer</div>
</div>

欢迎加 微信 共同学习~~~~~~

css 实现 stick-footer