IE6解决固定定位代码
有些朋友在进行网页布局时,会遇到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;
}
最新文章
- ionic tabs置顶
- 使用redis作为session的存储方式
- zipArchive
- Redmine2.5+CentOS6+Apache2
- Jmeter外部函数引用
- iOS 简单工厂模式
- Daily Scrum – 1/7
- 二叉搜索树(Binary Search Tree)
- pip使用报错【cannot import name HTTPSHandler】
- linux的Ubuntu
- 不窃取用户隐私的搜索引擎: DuckDuckGo
- 异常SRVE0199E
- webstorm javascript 分号提示如何自动补全或去掉?
- Java框架中Struts框架的优缺点
- centos开启防火墙
- MVC模式笔记
- JMS Session session = connection.createSession(paramA,paramB) 两个参数不同组合下的含义和区别
- jstl和EL表达式混合使用
- ActiveMQ使用的设计模式
- 一、Windows下Git的安装与配置
热门文章
- (转载)MySQL关键字ORDER BY的使用
- Linux学习笔记7——linux中的静态库和动态库
- 《A First Course in Probability》-chaper3-条件概率和独立性-P(·|F)是概率
- Ubuntu14.04 安装配置Hadoop2.6.0
- A*寻路算法的探寻与改良(一)
- HDU 3078 Network LCA
- oracle正则截取字符串的函数
- 无法将类型“System.Collections.Generic.IEnumerable<;EmailSystem.Model.TemplateInfo>;”隐式转换为“System.Collections.Generic.List<;EmailSystem.Model.TemplateInf
- [CSS] Animating SVG
- c++拷贝构造函数(深拷贝,浅拷贝)详解