#container {


              min-height:100vh;
              height: auto !important;
              position: relative;
              padding-bottom: 180px;
            }
            #header {
                background: #ff0;
                padding: 10px;
            }
            #page {
                width: 960px;
                height:1000px;
                margin: 0 auto;
                padding-bottom: 60px;/*等于footer的高度*/
            }
            #footer {
                position: absolute;
                bottom: 0;
                width: 100%;
                height: 60px;/*脚部的高度*/
                background: #6cf;
                clear:both;
            }

<div id="container">
            <div id="header">Header Section</div>
            <div id="page" class="clearfix">
                <div id="left">Left Sidebar</div>
                <div id="content">Main content</div>
                <div id="right">Right sidebar</div>
            </div>
            <div id="footer">Footer Section</div>
        </div>

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐