---
title: "使用CSS固定漂浮导航栏"
author: "berrywu"
date: "2010-05-10T11:43:41Z"
tags: ["CSS", "HTML"]
categories: ["编程语言"]
slug: "css"
draft: false
lastmod: "2010-05-10T11:44:25Z"
id: 662860
url: "https://berrywu.iteye.com/blog/662860"
---

1、CSS样式

```
body {
background-image:url(text.txt); /* for IE6 */
background-attachment:fixed;
}
#bottomNav {
z-index:999;
position:fixed;
bottom:0;	/*去掉此行则固定在页面顶部*/
left:0;
width:100%;
_position:absolute; /* for IE6 */
_top: expression(documentElement.scrollTop + documentElement.clientHeight-this.offsetHeight); /* for IE6 */
overflow:visible;
}
```

 

2、html部分

```
<div id="bottomNav">我是导航栏O(∩_∩)O~</div>
```