zoukankan      html  css  js  c++  java
  • IE6 透明图片 DIV + CSS

    用DIV撑图片的时候,在IE7下面发现好好的
    在IE6下面居然不行~~~

    后来发现,原因有2
    1. IE6对PNG格式支持的不好
    2. 可以用CSS Microsoft的filter滤镜来解决

    但最简单的办法就是将png格式换成gif格式

    注意不要被文件名骗了啊~~
    我就是被骗了,害我找了好久~~
    gif要是真正的gif格式才可以

    第一个是把div放在table的td里,td的bgcolor="#6d51a5",png图片放在div里,滤镜起到作用,显示正常,看来这个透明png可以的;
    <table align="center" border="0" cellSpacing="0" cellPadding="0" ID="Table2">
      
    <tr>
       
    <td width="400" bgcolor="#6d51a5">
        
    <div id="pngDiv" style="500;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image/FlowER_Logo_png.png',sizingMethod='image')><img src="image/FlowER_Logo_png.png" width="133" height="31"></div>
       
    </td>
      
    </tr>
     
    </table>

    第二个是把table放在div里,滤镜会把这个div里的颜色都滤掉,所以PNG图片的背景色没有;
    <div style="500;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image/FlowER_Logo_png.png',sizingMethod='image')>
      <table width="
    500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#6d51a5">
       
    <tr>
        
    <td width="400" bgcolor="#6d51a5"><img src="image/FlowER_Logo_png.png" width="133" height="31"></td>
       
    </tr>
         
      
    </table>
     
    </div>

    第三个div里是gif图片,有锯齿~~
    <div >
     
    <table width="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#6d51a5" ID="Table1">
      
    <tr>
       
    <td width="400" bgcolor="#6d51a5"><img src="image/FlowER_Logo_gif.gif" width="133" height="31"></td>
      
    </tr>  
     
    </table>
     
    </div>

    以上这些内容,有的经实践,好用是好用,只是偶尔不好用,奇怪的很

    经过美工才知道,原来gif的质量比png的质量要差,不过一般的应用应该是够用了
  • 相关阅读:
    proto,生成指定包名的java类
    龋齿比较深了还能补吗
    Spring Security with JWT for REST API[转]
    ci-Model使用方法
    ci-crud增删改查基本操作
    openjdk11 下载地址
    System.InvalidOperationException: Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found or is out of date.
    Newtonsoft.Json高级用法之枚举中文转义
    java中文与unicode编码之间的转换
    SpringBoot参数校验-Validator
  • 原文地址:https://www.cnblogs.com/forward/p/1035367.html
Copyright © 2011-2022 走看看