ie6 fixed 实现

 
<!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 charset="utf-8"/>
    <title>CSS Position Fixed for IE6</title>
    <style>
.fixed-top    {position:fixed;bottom:auto;top:0px;}
.fixed-bottom {position:fixed;bottom:0px;top:auto;}
 .fixed-right {position:fixed;right:0px;top:0;}

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


* html .fixed-top           {position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
* html .fixed-right  {position:absolute;right:0;top:expression( eval(document.documentElement.scrollTop));}
* html .fixed-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)));}
 

.fixed-bottom  {
  position:fixed;
  bottom:20px;
  background:blue;
  width:200px;
  height:200px;
}
.fixed-top  {
  position:fixed;
  
  background:blue;
  width:200px;
  height:200px;
}
.fixed-right  {
  position:fixed;
  bottom:20px;
  background:blue;
  width:200px;
  height:200px;
}
    </style>

  </head>
  <body>
    <div class="fixed-bottom ">ok1</div>
	 <div class="fixed-top">ok2</div>
	 <div class="fixed-right"></div>
<div style="height:1000px;"></div>
    </pre>
  </body>
</html>
posted @ 2010-12-20 23:05  oneroom  阅读(166)  评论(0编辑  收藏  举报
让别人快乐是慈悲,让自己快乐是智慧!