怎么让div始终沉于底部

来源:互联网 发布:gta5捏脸数据日本妹子 编辑:程序博客网 时间:2024/04/30 04:57

今晚闲来无事,在做自己主页的时候想写个“版权所有:xxx”,大家都知道,这个一般用小字,沉在底部。

谷歌了一下,看到这篇文章:

How to keep footers at the bottom of the page

<div id="container">   <div id="header"></div>   <div id="body"></div>   <div id="footer"></div></div>

这三个div想必能看的很清楚

下面是css:

html,body {   margin:0;   padding:0;   height:100%;}#container {   min-height:100%;   position:relative;}#header {   background:#ff0;   padding:10px;}#body {   padding:10px;   padding-bottom:60px;   /* Height of the footer */}#footer {   position:absolute;   bottom:0;   width:100%;   height:60px;   /* Height of the footer */   background:#6cf;}


读者们自己看看试试哈,

楼主先去试试水~

0 0