How to create PNG transparency work in IE 6

17 April 2009     Tag:
Home » Tutorials » How to create PNG transparency work in IE 6


Let’s take a look at the difference of PNG images (with transparency) above on Mozilla Firefox and Internet Explorer 6
If you inserting images in PNG format with transparancy will leave you with a white background when saw in Internet Explorer 5 or 6.

It makes your image looks not good and this is really the last thing any web designer would want on their website.
Don’t worry about that, I’ll give you a solution on how to solve this.


Create a container to store your image. In this case I use a <div>.
Create your <div> inside your <body>, just like this:

<body> <div class=”flower”></div> </body>

Next, create a <style> if you dont have one. Make sure they are between your <head> </head>. Put the following css inside:

body {background-color:#000}
div.flower {background:url(flower-transparent.png) no-repeat; height:100px; width:100px}

The CSS codes above displays your PNG image in a <div>. Works fine for Mozilla Firefok, but not for Internet Explorer. To get it working cross browser, create another set of css just for Internet Explorer right below your <style> </style>.
Insert the following codes:

<!–[if gte IE 5]>
<style type=”text/css”>
div.flower {
Microsoft.AlphaImageLoader  (src=’flower.png’ ,sizingMethod=’crop’);

Your IE should now give you a perfect blend like the picture below.


Bagikan Artikel:

Saran dan Komentar

  • Best you should change the blog subject Create PNG transparency work in IE 6 with css | Gusdwi dot Info to more generic for your webpage you write. I loved the post all the same.

  • Silahkan tulis saran, komentar dan pertanyaan dibawah!

    Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *