If you are CSS coder, you've probably ran in to png transparency problems many times. Even Microsoft is having problems with it http://runonce.msn.com/runonce2.aspx open in IE6. So I'll tell you few problems and solutions I've handled so far.
First one is if you need just simple transparent image, without some special needs for example backgrounds etc. The solution would be png fix. I've used it many times but it has lots of faults, for example with padding, margins and absolute positioning. Sometimes i can mess up the rest of your JavaScript files, but anyway very useful script. You can download it here http://homepage.ntlworld.com/bobosola/pngfix.js and just include it in your <head> tag

<!--[if lt IE 7.]> <script defer type="text/javascript" src="pngfix.js"></script> <![endif]-->
The second one can partly handle issues from first and it's pure CSS solution. I mostly use this for backgrounds, because if your path for a background is from CSS file then png fix can't handle it.

.someelement { background-image: url(images/image.png); } * html .someelemen { background-color: #333; back\ground-color: transparent; background-image: url(images/blank.gif); filter: progid:DXImageTransform.Microsoft. AlphaImageLoader(src="images/image.png", sizingMethod="scale"); }
I found this very useful, and also when you add some hover effects for example some color or other image. You can see live example here
NOTE: This simple hover is just example and it doesn't work in IE6
.someelement:hover { background: #333; } .someelement:hover { background-image: url(images/image2.gif); }
Only problem I had with this was with <a> tag, link just don't work (when it's in div with this kind of background) and i don't know why (talking again for IE6). And only solution i could think of was to place another absolute div over it for the links, content etc... Yes i know it's not elegant but it works if content is not dynamic.
Luckily more and more people are starting to use IE7, and i must say i have recently switched too, i had to have IE6 because of testing my code and when i found out for Multiple IE program I switched immediately
Have some feedback? Leave a comment



Wow,thanks. I didn’t know about this solutions of png transparency problems…
Thanks, for the great article, I also had few png problems and this helped me figure some of them out.
Hi Dejan, can you tell me if this “
AlphaImageLoader(src=”imag..” is in same row as “filter: pro...” ? I guess it is?@ Stan
Yes you are right thanks for pointing it out, but i thought it will be obvious without ; at the end of the row
You’ve seem to forgotten about the wonderful js library IE7
Hi, did you know any way to use background-position with png transparency on ie < 7?
@ Erik
Well you just treat it like regular image, for example
background: url(image.png) top left;To make the links inside a div with a transparent background work, just add:
.someelement a {
position: relative;
}
Hi there,
I got a prob with pngfix.js that works well and takes out all the errors of pngs when rendering in IE6 but the prob is that my links now do not work in my main content. http://www.gbackup.co.za.
Tried everything and cant find a sol..
Please can anyone help???
Hi Jerome,
I’ve looked at your site and the problem is in position:relative;
Header and footer links are working but content wrapper is relative and all inner divs. So just change that and let me know if it’s working
Also you can post your question on KnowHow forum for more help
and one more thing, where ever you are using float links are working so try to float rest of content that should help
Thanks a lot…
Just tried it and it works…oh my oh my… I got stuck on it for 1 and half day, thanks again.
Cheers.
Have a good day
jerome
There is another way, and it even works for PNG in CSS backgrounds.
http://www.twinhelix.com/css/iepngfix/
regards
There is a great solution, which fixes a lot of issues with ie6 and lower. And implements png transparency.
I found it by chance through an article over at 24 ways. Its by Dean Edwards:
http://dean.edwards.name/ie7/
And there is a google.code page to it:
http://code.google.com/p/ie7-js/
it has worked fine for me so far
Pingback: » I 10 migliori hack per CSS | DoZ-log |
Pingback: 10 best CSS hacks « DELE DURO!!!
Pingback: Thatgrafix Web Design Portland Oregon
Pingback: CSS-FAQ » Blog Archive » CSS Hacks for You! (First Serving)
Pingback: NilDesign.ru » 10 лучших CSS хаков + кроссбраузерность
Be aware that IE6 can deadlock when using the AlphaImageLoader. I wrote about it at http://blogs.cozi.com/tech/2008/03/transparent-png.html
Pingback: 10 best CSS hacks « Share4Vn.com Blog
What works perfectly with IE? That’s the question! Thank you for interesting article! Take care. Luke
@ Luke
Well everything from this, just use on or another for different things as in text
There’s always problem with IE alpha deadlock… What a crap!
Pingback: 10 best CSS hacks
Pingback: Internet Explorer 6 için saydam PNG desteği » Tekil Yazı » Fatih Hayrioğlu'nun not defteri
thank you nice sharing
I’m using pngfix.js now, didn’t know it had issues. I totally ran into the css bg png issue not rendering… thanks for this article. For my css bg tricks, i’m going back to good old gifs for the time being.
I love this blog, thanks.
Thanx
Pingback: positioning seo
Dostum cok gusel css Birazda türkce yazsanız daha iyi olmucakmı
exelente muchas gracias !!!
Pingback: SEO Elite Review
I’m using pngfix.js now, didn’t know it had issues. I totally ran into the css bg png issue not rendering… thanks for this article. For my css bg tricks, i’m going back to good old gifs for the time being
There’s always problem with IE alpha deadlock… What a crap!
I love this blog, thanks.
and one more thing, where ever you are using float links are working so try to float rest of content that should help
What works perfectly with IE? That’s the question! Thank you for interesting article! Take care. Luke
Thank you
Best Posting
What works perfectly with IE? That’s the question! Thank you for interesting article! Take care.
Pingback: A brand new PNG fix for IE6 | StylizedWeb.com
Pingback: Email:luvAdobe@gmail.com » 10 best CSS hacks
Pingback: Best Css hacks · Css Edge :: Your best CSS resource guide
this helped me so much! Thank you…
Pingback: 10 Great CSS Hacks « Thatgrafix Blog
thank you
Thx
thank you
Pingback: 10 best CSS hacks - namastec.info