有些朋友在进行网页布局时,会遇到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;
 }

IE6解决固定定位代码的更多相关文章

  1. ie6与固定定位fixed,+ 条件注释格式注意

    ie6并不支持position:fixed, ie7+都支持fixed定位, ie6固定定位实现方法1: <!DOCTYPE html> <html> <head> ...

  2. 解决IE6下浮动层固定定位的经典方法

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  3. 解决ie6下不支持fix属性,模拟固定定位

    <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content ...

  4. 解决IE6下固定定位问题 使用position:fixed

    IE6浏览器有太多的bug让制作网页的人头疼.这篇文章介绍的是介绍的是如何解决IE6不支持position:fixed;属性的办法. 如果我们需要做某个元素始终位于浏览器的底部,不会因为浏览器窗口的缩 ...

  5. IE6浏览器不支持固定定位(position:fixed)解决方案

    代码如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w ...

  6. IE6浏览器不支持固定定位(position:fixed)解决方案(转)

    IE6浏览器不支持固定定位(position:fixed)解决方案   来源:互联网 作者:佚名 时间:12-04 10:54:05 [大 中 小] 点评:有些朋友在进行网页布局时,会遇到IE6浏览器 ...

  7. input固定定位后,当input框获取到焦点时,会离开手机软键盘的解决方法

    前些天做页面时候遇到这样一个问题,将input框用position:fixed固定定位在最底部的时候,当Input获取焦点的时候,input框离开了手机软键盘,而不是吸附在软键盘上,效果如下图: 找了 ...

  8. 让IE6下支持固定定位

    让IE下支持固定定位 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http:// ...

  9. 理解CSS相对定位和固定定位

    × 目录 [1]相对定位 [2]固定定位 前面的话 一般地,说起定位元素是指position不为static的元素,包括relative.absolute和fixed.前面已经详细介绍过absolut ...

随机推荐

  1. [LeetCode#12] Roman to Integer

    Problem: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range ...

  2. ServiceStack.Redis 之 IRedisTypedClient

    IRedisTypedClient IRedisTypedClient类相当于IRedicClient的强类型版,其方法与属性大多数与IRedisClient类似. 它支持在Redis中使用Linq查 ...

  3. Axure RP Pro 6.5 正式版发布,新功能介绍,

    转:http://www.babesun.com/blog/page/5 2012-4-19,Axure公司发布了Axure RP Pro 6.5 正式版.网上高手发现了Axure支持多语言文件,以此 ...

  4. 原生javascript难点总结(1)---面向对象分析以及带来的思考

    ------*本文默认读者已有面向对象语言(OOP)的基础*------ 我们都知道在面向对象语言有三个基本特征 :  封装 ,继承 ,多态.而js初学者一般会觉得js同其他类C语言一样,有类似于Cl ...

  5. poj 3169 Layout

    Layout Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8610   Accepted: 4147 Descriptio ...

  6. Conversion between json and object using SBJson lib

    Define two methods in an object class as follows: @interface MyObject : NSObject @property (nonatomi ...

  7. 不区分大小写的in_array实现 thinkphp框架

    // 不区分大小写的in_array实现 function in_array_case($value,$array) { return in_array(strtolower($value),arra ...

  8. UVa1572 UVaLive6393 Self-Assembly

    填坑系列(p.172) 注意“可以旋转和翻转” 然后将每个字母看成点 不然边数就是n^2级的 #include<cstdio> #include<cstring> #inclu ...

  9. NET设计模式-单例模式(Singleton Pattern)

    1. 概述 Singleton Pattren 要求一个类有且仅有一个实例,并且提供一个全局变量.这个创建的对象是独一无二的,在这个单独对象实例中,集中所创建类的所有属性和方法. 在创建一个单例,何时 ...

  10. iOS开发雕虫小技之傻瓜式定位神器-超简单方式解决iOS后台定时定位

    1.概述 由于公司一款产品的需求,最近一直在研究iOS设备的后台定位.主要的难点就是,当系统进入后台之后,程序会被挂起,届时定时器.以及代码都不会Run~ 所以一旦用户将我的App先换到了后台,我的定 ...