让IE下支持固定定位

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
body {
_background-image: url(null); /*空背景*/
/*_background-image: url(about:blank);*/
_background-attachment: fixed; /* 固定背景 */
} #fixed {
position: fixed;
top: 50%; /* 非IE下的定位 */
_position: absolute; /*IE6 用absolute模拟fixed*/
_top: expression(document.documentElement.scrollTop + Math.round (
document.documentElement.offsetHeight/ 2)+ "px"); /*IE6 动态top值*/
right: 0;
width: 30px;
height: 100px;
margin-top: -50px;
background: #F30;
}
</style>
</head>
<body style="height: 3000px;">
<div id="fixed"></div>
</body>
</html>
 <style>
.box{height:2000px;}
.div{width:100px;height:100px;background:red; position:fixed;left:100px;top:100px; _position:absolute;_top:expression(eval(document.documentElement.scrollTop+100));
}
</style>
</head>
<body>
<div class="box">
<div class="div"></div>
</div>

让IE6下支持固定定位的更多相关文章

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

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

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

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

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

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

  4. 前端学习 -- Html&Css -- 相对定位 绝对定位 固定定位

    相对定位 - 定位指的就是将指定的元素摆放到页面的任意位置,通过定位可以任意的摆放元素. - 通过position属性来设置元素的定位. -可选值: static:默认值,元素没有开启定位: rela ...

  5. IE6解决固定定位代码

    有些朋友在进行网页布局时,会遇到IE6浏览器不支持固定定位的兼容性问题,本博将详细介绍此问题的解决方法,需要了解的朋友可以参考下. ie6 垂直居中固定定位,代码如下: #center {_posit ...

  6. 转载:牛魔王的世界观 »谈谈ie6不支持min-height与max-height的解决方法

    转载网址:http://www.niumowang.org/html-css/ie6-min-height/ 手里的项目还在继续,今天正好遇到了min-height的问题,干脆在这里记录下来.我是喜欢 ...

  7. 前端CSS - 相对定位,绝对定位,固定定位

    前端CSS - 相对定位,绝对定位,固定定位 1.1 相对定位 position:relative 相对定位,就是微调元素位置的.让元素相对自己原来的位置,进行位置的微调. 也就是说,如果一个盒子想进 ...

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

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

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

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

随机推荐

  1. Careercup - Facebook面试题 - 4909367207919616

    2014-05-01 01:23 题目链接 原题: WAP to modify the array such that arr[I] = arr[arr[I]]. Do this in place i ...

  2. BAT CMD 批处理文件脚本 -2

    http://checheng1988.blog.51cto.com/4725808/1090733 在很多windows程序中会见到很多用扩展名为.bat和.cmd结尾的文件,那么这些文件能干什么呢 ...

  3. PHP读取xml之cdata讲解

    实例: xss.xml <?xml version="1.0" encoding="UTF-8"?><filters>    <f ...

  4. spoj 78

    数学  组合 隔板法 #include <iostream> #include <cstring> #include <cstdio> #include <s ...

  5. Java Socket编程readLine返回null,read返回-1的条件

    客户端正常关闭socket的时候,服务器端的readLine()方法会返回null,或者read()方法会返回-1

  6. VisualSvn+TortoiseSVN的安装说明

    一.VisualSvn安装及简单使用 下载VisualSvn:VisualSVN-Server-2.5.5.msi 系统:Win7系统 安装步骤: 1.下载VisualSVN-Server-2.5.5 ...

  7. Cache 应用程序数据缓存

    System.Web.Caching 命名空间提供用于缓存服务器上常用数据的类.此命名空间包括 Cache 类,该类是一个字典,您可以在其中存储任意数据对象,如哈希表和数据集.它还为这些对象提供了失效 ...

  8. vector、string实现大数加法乘法

    理解 vector 是一个容器,是一个数据集,里边装了很多个元素.与数组最大的不同是 vector 可以动态增长. 用 vector 实现大数运算的关键是,以 string 的方式读入一个大数,然后将 ...

  9. LR_问题_运行场景时提示scripts you are running in invalid

    问题描述 脚本在virtual user generator中运行正常. 在Controller中运行场景时报错: the target you defined cannot be reached. ...

  10. 表连接到底咋回事,就是产生中间结果啊!用于给select/insert等操作用

    1.表连接到底咋回事,就是产生中间结果啊!用于给select/insert等操作用啊. 2.表连接产生的结果用于select/insert用 3.表连接产生的结果用于select/insert用 比如 ...