IE6 Transparent PNG problem

Internet_Explorer_7_Logo_red

We all have faced this problem during HTML development. Internet Explorer 6 renders transparent PNG images in different way.  It puts some other color , it damages the design.

One solution is create gif images for IE6 and mention those in separate style sheet file for IE6

<!--[if IE 6]>
<link rel="stylesheet" href="css/style-ie6.css" type="text/css" media="screen"  />
<![endif]-->

A simpel solution is IE PNG FIX  javascript library.

You can download that library from : http://www.twinhelix.com/css/iepngfix/

You can see an online demo and usage here:

http://www.twinhelix.com/css/iepngfix/demo/

Remember to add that htc file inside your style sheet or like this:

<script>

/** transparent png ie fix **/

if (document.all && /MSIE (5\.5|6)/.test(navigator.userAgent) && document.styleSheets && document.styleSheets[0] && document.styleSheets[0].addRule)

{

 document.styleSheets[0].addRule('.transparent', 'behavior: url(css/iepngfix.htc)');

}

/****/

</script>
1 Comments

One Response to “IE6 Transparent PNG problem”

  1. Randy July 10, 2010 at 5:01 pm #

    I can’t tell you how many times I wanted to use a transparent PNG. I could never get a GIF to look even close. I like the red IE logo too.

Leave a Reply

More in php (19 of 101 articles)


Here is a php function which returns from and to date as an array for a range: <?php function ...