您现在的位置:首页 >> 网站建设 >> 建站经验 >> 信息正文

完美解决IE6 fixed 固定层效果!

2011-8-12 23:49:07 来源: 南天互联 作者:站长 录入:admin 访问:10153 次 被顶:1 次 字号:【
核心提示:!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层的问题。不敢私藏,与大家分享!

  • 上一篇:css表格、背景、文本属性
  • 下一篇:没有了
  • 参与评论
    共有评论 0网友评论列表
    © CopyRight 2009 南天互联帮助中心, Inc.All Rights Reserved.
    Powered by:南天互联 Design by:Nicnt 鲁ICP备08105365号