---
title: "一段始终保持在最底部的div css代码"
author: "submaze"
date: "2012-11-28T22:54:14Z"
tags: []
categories: ["Web前端"]
slug: "div-css"
draft: false
lastmod: "2012-12-20T13:59:35Z"
id: 1737826
url: "https://submaze.iteye.com/blog/1737826"
---

```html


.footer
{
    background: #eee;
    text-align: center;
    bottom:0px;
    position:fixed;
    height: 30px;
    line-height: 30px;
    width: 100%;
    _position: absolute; /*兼容IE6*/
    _top: expression(offsetParent.scrollTop+document.documentElement.clientHeight-this.offsetHeight); /*兼容IE6*/
}

```


注意：代码在使用过程中_top:expression...这一行代码，遇到不兼容IE7的JS问题