有个限制,一定要设置一下DOCTYPE
给需要fixed的元素加个类名class='fixed'
普通的style里面
div.fixed {
position; fixed
}
给支持fixed的浏览器
然后加上
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
给需要fixed的元素加个类名class='fixed'
普通的style里面
div.fixed {
position; fixed
}
给支持fixed的浏览器
然后加上
<!--[if lte IE 6]>
<style type="text/css">
html, body
{
height: 100%;
overflow: auto;
}
div.fixed {
position: absolute;
}
</style>
<![endif]-->