核心提示:!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'h...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
body{ margin:0px; padding:0px; background:url(notfound) fixed;}
.nextpage {
background:#000;
color:#fff;
bottom: 0;
margin: 0 auto;
position: fixed;
height:23px;
opacity: .60;
filter: alpha(opacity=60);
line-height:23px;
width: 100%;
z-index: 999;
_bottom:auto;
_width: 100%;
_position: absolute;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
}
</style>
</head>
<body>
<div style="height:3000px;"></div>
<div class="nextpage">我在ie6下也不会动!神奇吧!</div>
</body>
</html>
我们要注意2个地方
第一个就是固定层本身,针对IE6写如下样式
z-index: 999;
_bottom:auto;
_width: 100%;
_position: absolute;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));
}
第二个地方:
body的背景,要用到fixed属性,这个属性很关键。但这个属性必须配合url来实现,单独使用的话,fixed属性是不会触发的。我也试过用颜色,但好像没用!如果你实在没有背景,你可以在url里随便写点什么,但不能空着!
这是我目前见到的比较完美的解决了ie6 fixed层的问题。不敢私藏,与大家分享!