zoukankan      html  css  js  c++  java
  • 固定div在指定位置兼容写法

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无闪动的div层固定</title>
    <style type="text/css">
    body{margin:0px; padding:0px;}
    #fixedBottom{
    position:fixed; bottom:100px; 
    _position:absolute; _bottom:100px;
    _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginBottom,10)||100)));
    width:100%; height:30px; line-height:30px; border:1px solid #ccc;
    }
    #fixedTop{
    position:fixed; top:0px; 
    _position:absolute; _top:100px;
    _top:expression(eval(document.documentElement.scrollTop+(parseInt(this.currentStyle.marginTop,10)||100)));
    width:100%; height:30px; line-height:30px; border:1px solid #ccc;
    }
    *html{background-image:url(about:blank);background-attachment:fixed;}
    </style>
    </head>
    <body style="height:2000px;">
    
    <div id="fixedTop">我吃了定心丹,风吹不动,雷打不动,我就定在这愁着你!</div> 
    
    <div id="fixedBottom">我吃了定心丹,风吹不动,雷打不动,我就定在这愁着你!</div>
    
    </body>
    </html>
  • 相关阅读:
    逆变和协变
    委托的泛型版本
    委托的协变和逆变
    IIS8应用池重启脚本
    JS获取url参数及url编码、解码
    Jmeter压测Thrift服务接口
    浏览器插件及好用的小工具
    Jmeter入门实例
    BugBash活动分享
    如何作缺陷分析
  • 原文地址:https://www.cnblogs.com/yuejin/p/2872266.html
Copyright © 2011-2022 走看看