CSS如何把DIV永远置于页面的底部
https://www.flypeng.com win10系统 发布时间:2017-08-17 00:00 来源:鹏鹏电脑知识网
这个div如果位置在所有div的后面,那么只要前面的div 的高度够高的话,它的位置就会在页面的页面的底部的,一般想你这种说的要让他在页面底部的话都是页面高度太小,占不了满屏,导致页面底部部分下面有空白,你可以给这个div 前面的大的div 一个最小高度,让它撑起来。
<style>
.main{min-height: 700px;}
</style>
<div class="header"></div>
<div class="main"></div>
<div class="footer"></div>

还有一种方法是给body相对定位,给这个div 绝对定位到底部
<body>
<style>
body{position: relative;height: 1000px;}
.footer{position: absolute;bottom: 0;left: 0;height: 20px;width: 100%;background-color: yellow;}
</style>
<div class="header"></div>
<div class="main"></div>
<div class="footer"></div>
</body>
如果你有好的win10资讯或者win10教程,以及win10相关的问题想要获得win10系统下载的关注与报道。
欢迎加入发送邮件到#qq.com(#替换为@)。期待你的好消息!