CSS让页脚始终固定在底部不论页面内容多少

发布时间:2019-12-28 11:28:08   分类:网页代码0
<!DOCTYPE HTML> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>css实现页脚始终固定在底部,并且不论页面内容多少</title> 
<style type="text/css"> 
* {padding: 0;margin: 0;} 
html {*overflow: auto;} 
body {_width: expression(this.parentNode.clientWidth);} 
html,body {height: 100%;} 
.section {min-height: 100%;_height: 100%;} 
.footer {height: 60px;background: #000;margin-top: -60px;color: #FFF;} 
</style> 
</head> 
<body> 
<div class="section"> 
<script type="text/javascript"> 
for(var i=0; i<50; i++){ 
document.write(i+'<br/>'); 

</script> 
</div> 
<div class="footer">我是页脚</div> 
</body> 
</html> 
QQ咨询