让position:fixed在IE6下可用!

模板网 2014-09-13
/*让position:fixed在IE6下可用!*/
.fixed-top/*头部固定*/{position:fixed;bottom:auto;top:0px;}
.fixed-bottom/*底部固定*/{position:fixed;bottom:0px;top:auto;}
.fixed-left/*左侧固定*/{position:fixed;right:auto;left:0px;}
.fixed-right/*右侧固定*/{position:fixed;right:0px;left:auto;}
/*上面的是除了IE6的主流浏览器通用的方法*/
*html,*htmlbody/*修正IE6振动bug*/{background-image:url(about:blank);background-attachment:fixed;}
*html.fixed-top/*IE6头部固定*/{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
*html.fixed-right/*IE6右侧固定*/{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}
*html.fixed-bottom/*IE6底部固定*/{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));}
*html.fixed-left/*IE6左侧固定*/{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft));} 

相关文章

  1. CSS样式重置代码详细作用注释

    CSS样式重置代码详细作用注释,解决因不同浏览器样式解析方面存在的差异导致页面布局不统一的问题。代码包含详细注释,方便理解与修改。 详细代码: 复制代码 代码如下: @charset utf-8; /* ---------------------------------------- reset.css Description

  2. html禁止手机页面放大缩小代码

    只需网页头部head标签内添加一下代码即可实现禁止手机页面放大缩

  3. a标签点击过后出现虚线的解决方法

    问题:a标签点击过后出现虚线 解决方法:a{blr:expression(this.onFocus=this.blur());outline: none;}

  4. 隐藏统计代码的LOGO文字

    网站上添加网站统计代码后,一些情况下会影响网站整体的美观性,我们可以通过以下代码来隐藏统计代码的LOGO或文字。 将各种统计代码放到以下div中即可: 复制代码 代码如下: !--统计代码开始-- div style=display:none; !--百度统计-- script type=text/java

  5. window.onerror()的详细用法

    window.onerror = function(sMessage,sUrl,sLine){}; onerror函数的三个参数用于确定错误确切的信息,代表的意思依次为:错误信息;发生错误的文件;发生错误的行号。 示例: 复制代码 代码如下: SCRIPT window.onerror=fnErrorTrap; function fnErrorTrap(s

随机推荐

  1. CSS样式重置代码详细作用注释

    CSS样式重置代码详细作用注释,解决因不同浏览器样式解析方面存在的差异导致页面布局不统一的问题。代码包含详细注释,方便理解与修改。 详细代码: 复制代码 代码如下: @charset utf-8; /* ---------------------------------------- reset.css Description

  2. html禁止手机页面放大缩小代码

    只需网页头部head标签内添加一下代码即可实现禁止手机页面放大缩

  3. a标签点击过后出现虚线的解决方法

    问题:a标签点击过后出现虚线 解决方法:a{blr:expression(this.onFocus=this.blur());outline: none;}

  4. 隐藏统计代码的LOGO文字

    网站上添加网站统计代码后,一些情况下会影响网站整体的美观性,我们可以通过以下代码来隐藏统计代码的LOGO或文字。 将各种统计代码放到以下div中即可: 复制代码 代码如下: !--统计代码开始-- div style=display:none; !--百度统计-- script type=text/java

  5. window.onerror()的详细用法

    window.onerror = function(sMessage,sUrl,sLine){}; onerror函数的三个参数用于确定错误确切的信息,代表的意思依次为:错误信息;发生错误的文件;发生错误的行号。 示例: 复制代码 代码如下: SCRIPT window.onerror=fnErrorTrap; function fnErrorTrap(s