有些朋友在进行网页布局时,会遇到IE6浏览器不支持固定定位的兼容性问题,本博将详细介绍此问题的解决方法,需要了解的朋友可以参考下。

ie6 垂直居中固定定位,代码如下:

#center {
_position:absolute;
_top:expression(eval(document.compatMode && document.compatMode=='CSS1Compat') ? documentElement.scrollTop + (document.documentElement.clientHeight-this.offsetHeight)/2 :/*IE6*/document.body.scrollTop + (document.body.clientHeight - this.clientHeight)/2);/*IE5 IE5.5*/
}

*html{
 background-image:url(about:blank);
 background-attachment:fixed;
 }

ie6 底部固定定位,代码如下:

#bottom {
_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{
 background-image:url(about:blank);
 background-attachment:fixed;
 }

ie6 头部固定定位,代码如下:

#top {
_position: absolute;
_bottom: auto;
_top: expression(eval(document.documentElement.scrollTop));
}

*html{
 background-image:url(about:blank);
 background-attachment:fixed;
 }

最新文章

  1. ionic tabs置顶
  2. 使用redis作为session的存储方式
  3. zipArchive
  4. Redmine2.5+CentOS6+Apache2
  5. Jmeter外部函数引用
  6. iOS 简单工厂模式
  7. Daily Scrum – 1/7
  8. 二叉搜索树(Binary Search Tree)
  9. pip使用报错【cannot import name HTTPSHandler】
  10. linux的Ubuntu
  11. 不窃取用户隐私的搜索引擎: DuckDuckGo
  12. 异常SRVE0199E
  13. webstorm javascript 分号提示如何自动补全或去掉?
  14. Java框架中Struts框架的优缺点
  15. centos开启防火墙
  16. MVC模式笔记
  17. JMS Session session = connection.createSession(paramA,paramB) 两个参数不同组合下的含义和区别
  18. jstl和EL表达式混合使用
  19. ActiveMQ使用的设计模式
  20. 一、Windows下Git的安装与配置

热门文章

  1. (转载)MySQL关键字ORDER BY的使用
  2. Linux学习笔记7——linux中的静态库和动态库
  3. 《A First Course in Probability》-chaper3-条件概率和独立性-P(·|F)是概率
  4. Ubuntu14.04 安装配置Hadoop2.6.0
  5. A*寻路算法的探寻与改良(一)
  6. HDU 3078 Network LCA
  7. oracle正则截取字符串的函数
  8. 无法将类型“System.Collections.Generic.IEnumerable<EmailSystem.Model.TemplateInfo>”隐式转换为“System.Collections.Generic.List<EmailSystem.Model.TemplateInf
  9. [CSS] Animating SVG
  10. c++拷贝构造函数(深拷贝,浅拷贝)详解