您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

如何使页脚停留在网页的底部?

如何使页脚停留在网页的底部?

要获得页脚的粘性:

一个<div>class="wrapper"您的内容

右 收盘</div>的的wrapper地方 <div class="push"></div>

权 收盘</div>的的wrapper地方 <div class="footer"></div>

* {
    margin: 0;
}
html, body {
    height: 100%;
}
.wrapper {
    min-height: 100%;
    height: auto !important;
    height: 100%;
    margin: 0 auto -142px; /* the bottom margin is the negative value of the footer's height */
}
.footer, .push {
    height: 142px; /* .push must be the same height as .footer */
}
其他 2022/1/1 18:18:26 有494人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶