css方法实现div固定浏览器底端

CSS:

body{ margin:0; padding:0;background-image:url(text.txt);/*for IE6 防抖,也可以用一张图片URL*/
 background-attachment:fixed;} /*是否存在这文件无所谓,要fixed,不能用scroll */  
.main{ height:1800px;}
.footer{ color:red; left:0;background:#ccc; height:30px; position:fixed; bottom:0; z-index:999;  overflow:visible;
/* for IE6 */
 _top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight);
 _position:absolute;
 /* for IE6 */}

body:

<div class="main">这是内容层</div>
<div class="footer">我在底部</div>

  

posted @ 2013-07-02 17:31  tinyphp  Views(6421)  Comments(0Edit  收藏  举报