We all know IE6 is a bag ‘o’ shite poo right? Well unfortunately there are still loads of people who use it. This is not necessarily a problem in itself, after all as long and we do our CSS properly and understand the limitations of the browser, everything should be ok.
One area that does cause loads of headaches though is transparent PNGs and with more and more of our designs using gradient backgrounds and varying levels of transparency in their graphics, it’s inevitbale that you’ll have to use PNGs as opposed to GIFs to achieve the desired look of the site.
There is a really good and simple PNG fix which I’ve been using for a while and all you need to do to implement it is this:
- Get yourself downloading this JS file – PNG Fix for IE6
- In your header, insert the following code:
<!--[if IE 6]> <script src="js/pngfix.js"></script> <script> DD_belatedPNG.fix(); </script> <![endif]-->
- The function DD_belatedPNG.fix loads the png fix at runtime and all you need to do now is pass it each element that needs the fix applying. This can either be a class or an id for example:
<!--[if IE 6]> <script src="js/pngfix.js"></script> <script> DD_belatedPNG.fix('img, .png_img'); </script> <![endif]-->
Some Further Notes on this:
- You cannot use ‘body’ as one of your elements
- It doesn’t work on <TR> or <TD> elements, but this *shouldn’t* be a problem should it
- <INPUT type=”image”/> doesn’t work but why use a transparent PNG for a form button anyway?



April 2nd, 2009 at 1:12 pm
Where does item 3 go?
April 2nd, 2009 at 1:52 pm
Hi Brad, tweaked instructions above to describe placement
April 11th, 2009 at 1:51 am
the illustration makes the article interesting!
Millie’s last blog post..Catching witmin.cn-Wrapper Life 爱生活
April 14th, 2009 at 6:18 pm
[...] PNG Fix for IE6 [...]