• 兼容IE6的页面底部固定层CSS代码


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

    .bottom {
        background:#000;
        color:#fff;
        bottom:0;
        margin:0 auto;
        position:fixed;
        height:23px;
        opacity:.60;
        filter:alpha(opacity=60);
        line-height:23px;
        width:100%;
        z-index:999;
        _bottom:auto;
        _width:100%;
        _position:absolute;
    _top:expression(eval(document.documentElement.scrollTop+document.documentElement.clientHeight-this.offsetHeight-(parseInt(this.currentStyle.marginTop, 10)||0)-(parseInt(this.currentStyle.marginBottom, 10)||0)));
    }

    需要注意的是:使用以上代码后在ie中你会发现被固定定位的元素在滚动滚动条的时候会闪动,下面给出解决方法:

    body{background:url(notfound)fixed;}

    这样ie6中不支持fixed问题算是解决了。

  • 相关阅读:
    B
    R
    C
    B
    异步解决方案----Promise与Await
    NPM 与 Nodejs
    借助node.js + mysql 学习基础ajax~
    bind、call、apply的区别与实现原理
    私有 npm 仓库的搭建
    学习 Promise,掌握未来世界 JS 异步编程基础
  • 原文地址:https://www.cnblogs.com/rightzhao/p/3474232.html
Copyright © 2020-2023  润新知