今晚闲来无事,在做自己主页的时候想写个“版权所有: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;
}
读者们自己看看试试哈,
楼主先去试试水~