• CSS效果:固定页脚、PNG透明、最小高度 3枚


    8.固定页脚

    在网页里添加固定的页脚其实非常简单,并且也很实用。有些网站的页脚设计得很漂亮,可以给网站呈现出一个完美的结尾。

    #footer {
        position: fixed;
        left: 0px;
        bottom: 0px;
        height: 30px;
        100%;
        background: #444;
    }
    /* IE 6 */* html #footer {
        position: absolute;
        top: expression((0-(footer.offsetHeight)+(document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight)+(ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop))+'px');
    }

    9.IE 6下修复PNG格式的透明度

    在网站里使用透明的图像已成为一种很普遍的做法,其始于.gif图片格式,但现在也涉及到.png图片格式。而一些老版本的IE不支持透明度,下面这段代码会很好地解决这一问题。

    .bg {
        200px;
        height:100px;
        background: url(/folder/yourimage.png) no-repeat;
        _background:none;
        _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/folder/yourimage.png',sizingMethod='crop');
    }
    /* 1px gif method */img, .png {
        position: relative;
        behavior: expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
           this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
           this.src = "images/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
           this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
           this.runtimeStyle.backgroundImage = "none")),this.pngSet=true));
    }

    10.跨浏览器设置最小高度

    有时开发者需要对HTML元素设置最小高度,然而,这个效果却无法兼容IE和老版本的Firefox,下面这段代码可以修复这个问题。

    #container {
        min-height: 550px;
        height: auto !important;
        height: 550px;
    }

  • 相关阅读:
    git管理多个分支并进行合并merge等操作记录
    【USENIX ATC】支持异构GPU集群的超大规模模型的高效的分布式训练框架Whale
    关于程序员的职业操守,从《匠艺整洁之道》谈起
    Serverless 时代下微服务应用全托管解决方案
    6000字干货分享:数据中台项目管理实践分享
    当 Knative 遇见 WebAssembly
    低代码渲染那些事
    【SIGIR 2022】面向长代码序列的Transformer模型优化方法,提升长代码场景性能
    云原生消息队列Pulsar浅析
    全链路压测:影子库与影子表之争
  • 原文地址:https://www.cnblogs.com/Denny_Yang/p/3106306.html
Copyright © 2020-2023  润新知