zoukankan      html  css  js  c++  java
  • 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;
    }

  • 相关阅读:
    非域环境下搭建自动故障转移镜像无法将 ALTER DATABASE 命令发送到远程服务器实例的解决办法
    AWS 免费套餐
    SQL Server全时区转换
    SQL Server 连接问题案例解析(1)
    SQL Saturday活动再起
    SqlServerProxy的一些资料
    数据是企业的无价財富——爱数备份存储柜server的初体验(图文)
    JEECG第二期深入使用培训(报名截止2014-06-21)
    Java提高篇(三三)-----Map总结
    经常使用哈希函数的比較及其C语言实现
  • 原文地址:https://www.cnblogs.com/Denny_Yang/p/3106306.html
Copyright © 2011-2022 走看看