JS解决ie6下png透明的方法实例

复制代码 代码如下:

  <!DOCTYPE html>

  <html lang="en">

  <head>

  <title>解决ie6下png透明方法之JS法-</title>

  <style type="text/css">

  .a{background: #FFFF99 ;  background-image: url(bg.jpg); height:800px;padding: 50px;  }

  .b{ float: left;  background: url(tra.png) no-repeat 0 0; width:240px; height:307px; margin-right:20px;}

  </style>

  <!--[if IE 6]> //只有IE6才调用

  <script src="http://www.glzy8.com/js/iepng.js" type="text/javascript"></script> //此处调用透明的JS

  <script type="text/javascript">

  EvPNG.fix('div, ul, img, li, input');  //EvPNG.fix('包含透明PNG图片的标签'); 多个标签之间用英文逗号隔开。

  </script>

  <![endif]-->

  </head>

  <body>

  <div class="a">

  <div class="b">

  <p>管理资源吧</p>

  <p><a href="http://www.glzy8.com">www.glzy8.com</a></p>

  <p>上边的链接可以点开哟</p>

  </div><!--背景调用-->

  <img src="tra.png" width="240"  height="307" alt="" /><!--页面插入图片-->

  </div>

  </body>

  </html>