悬停效果 静止不动 不随滚动条滚动 纯css实现

来源:互联网 发布:螺纹编程 编辑:程序博客网 时间:2024/06/04 18:41
  1. <style>  
  2. .aa{height:2000px;width:40px;background:#eee;}   
  3. .bb{width:50px;height:80px;background:red;float:right;   
  4.     position:fixed !important; top/**/:0px;   
  5.     position:absolute; z-index:100; top:expression(offsetParent.scrollTop+20);right:20px;   
  6. </style>  
  7.   
  8. <div class="aa">  
  9.     我是不动的。   
  10.     <script>for(var i=0;i<99;i++){document.write(i+"<br>");}</script>  
  11.   
  12.     <div class="bb">move</div>  
  13.   
  14. </div>   
原创粉丝点击