#e_float{
_position:absolute;
_bottom:auto;
_right:50%;
_margin-right:-536px;
_top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop,10)||0)-(parseInt(this.currentStyle.marginBottom,10)||0)));

}

上面的只是一个例子,下面的才是最重要的代码片段:

使元素固定在浏览器的顶部

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

使元素固定在浏览器的底部

#top {      _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))); }

这两段代码只能实现在最底部跟最顶部,你可以使用 _margin-top:10px; 或者 _margin-bottom:10px;修改其中的数值控制元素的位置。

position:fixed; 闪动问题

现在,问题还没有完全解决。在用了上面的办法后,你会发现:被固定定位的元素在滚动滚动条的时候会闪动。解决闪动问题的办法是在 CSS 文件中加入:

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

其中 * 是给 IE6 识别的。

到此,IE6 的 position:fixed; 问题已经被解决了。

解决 IE6 position:fixed 固定定位问题的更多相关文章

  1. 完美解决 IE6 position:fixed 固定定位问题

    关于 position:fixed; 属性 生成绝对定位的元素,相对于浏览器窗口进行定位. 元素的位置通过 “left”, “top”, “right” 以及 “bottom” 属性进行规定. pos ...

  2. 解决IE6浏览器下position:fixed固定定位问题

    像你所遇到的问题一样, IE6浏览器有太多的bug让制作网页的人头疼.这篇文章介绍的是介绍的是如何解决IE6不支持position:fixed;属性的办法.如果我们需要做某个元素始终位于浏览器的底部, ...

  3. jquery返回顶部和底部插件和解决ie6下fixed插件

    (function($){ //返回顶部和底部插件 $.fn.extend({ goTopBootom:function (options){ //默认参数 var defaults = { &quo ...

  4. 浮动层固定兼容IE6 position:fixed的最佳解决方案

    第一种:css方法 有时候当我们需要把一个元素固定在页面的某个部位,一般都是用css中的“position:fixed;”方法来解决,但是IE6不支持fixed,所以今天分享一个兼容IE6的页面底部固 ...

  5. 解决 scroll() position:fixed 抖动、导航菜单固定头部(底部)跟随屏幕滚动

    一.导航栏或者页脚正常情况下固定在页面的相应位置,当页面滚动后,导航栏或者页脚固定在页面的顶部或者底部的情景 一般就是将该块的代码样式的position设置为fixed.固定在顶部的话,将top设置为 ...

  6. 完美解决IE6中fixed抖动问题的方法

    我们可以通过position:fixed来实现元素的固定效果,如网页中底部的"回到顶部菜单",底部的toolbar,对联广告等等,可惜fixed属性在IE6及以下是不支持的.通常的 ...

  7. 两种解决IE6不支持固定定位的方法

    有两种让IE6支持position:fixed1.用CSS执行表达式 *{margin:0;padding:0;} * html,* html body{ background-image:url(a ...

  8. 【微信小程序】view顶部固定或底部固定 + scroll-view中的元素view也可以使用position:fixed;固定选中元素位置

    1.顶端固定核心代码如下: <view class="page__hd" style="position:fixed; top:0;width: 750rpx;&q ...

  9. 移动端— position: fixed;固定定位解决方案

    这里有个关键的东西叫做viewport,你经常在页面的头部里可以见到它: <meta name="viewport" content="width=device-w ...

随机推荐

  1. promise基础用法

    /** * Created by liyinghao on 2016/11/6. */ const fs = require('fs'); /* * 新建一个Promise对象,Promise就是一个 ...

  2. 数据库的基本使用(C#语言)

    目录 insert select 的使用 delete update 更新 Like模糊查询 Order 排序 GETDATA() 聚合函数:MAX,MIN,AVG,SUM,COUNT Max COU ...

  3. 点读系列《Jenkins用户文档》

    Jenkins用户手册官网地址:点击打开 开源 CI&CD 软件 自动化各种任务, build test deploy 支持各种运行方式 Jenkins入门 入门指南 需要java和docke ...

  4. 20-python基础-python3-reversed()函数

    描述 reversed 函数返回一个反转的迭代器. 语法 reversed(seq) 参数 seq -- 要转换的序列,可以是 tuple, string, list 或 range. # 字符串 s ...

  5. android中的文件存储

    Context类中提供的IO方法: FileOutputSream openFileOutput(String name, int mode):打开应用程序中的/data/data/<应用程序的 ...

  6. Cannot proxy target class because CGLIB2 is not available .Add CGLIB to the class path or specify proxy interfaces…..

    报错:Cannot proxy target class because CGLIB2 is not available .Add CGLIB to the class path or specify ...

  7. chroot 试用alpinelinux安装软件包的问题

    前边有说明使用chroot 体验alpinelinux,但是因为默认没有dns server,造成软件包无法下载 现象 问题原因 解决方法 copy host resolv.conf 到alpine ...

  8. 重新开始学习C++

    从2002年,大二的那个夏天开始,就接触了C++这门语言,大学那会就是在老师不停教育下,背诵C++的各种特征,完全不知道C++干嘛用的,当然自然也是不知道汇编语言,C语言是干嘛用的,老师让学就学吧.那 ...

  9. Android中的Handler,Looper,Message机制

    Android的消息处理有三个核心类:Looper,Handler和Message.其实还有一个Message Queue(消息队列),但是MQ被封装到Looper里面了,我们不会直接与MQ打交道,因 ...

  10. 暴力字符串hash——cf1200E

    #include<bits/stdc++.h> using namespace std; #define ll long long #define N 1000005 #define mo ...