Log in

View Full Version : png transparency - revisited



stevedc
06-12-2008, 01:02 AM
Hi all,

I know this subject has been exhausted a bit over the past few years, but I have to find a really good work around for png transparency bugs in IE 6 and below. I've used this one (http://www.twinhelix.com/css/iepngfix/)many of times in the past. However, I've noticed that my pages dont validate well with the W3C. I'm wondering if anyone has any thoughts or workarounds for a standards compliant png fix. I've actually done some searching and testing over the past few months, but still found nothing. So, I apologize for the "png transparency fix / bug" - I know it's been discussed a lot.

~ Regards
Steve Case

Medyman
06-12-2008, 02:26 AM
If you're talking about true standards compliance -- with HTML as well as CSS, the only real way is to to do it through a javascript method (http://jquery.andreaseberhard.de/pngFix/).

If you're only talking about HTML standards, you should be able to use proprietary IE filters (http://www.drunkenfist.com/304/2006/10/20/cross-browser-png-transparency/) and relegate all IE6 png transparency hacking into external CSS files.

jscheuer1
06-12-2008, 02:56 AM
The twinhelix method stevedc mentions (at):

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

can be made 'standards compliant'. However, no method will be truly standards compliant, not even javascript. All javascript does in this case is hide the non-compliant code from the validator. The same can be done (using IE conditional comments or javascript) using the twinhelix method.

The twinhelix method uses a .htc behavior, which itself is basically just a fancy (and often very convenient) way of applying javascript to the situation.

Although it usually isn't all that important, it should be noted that no method of 'fixing' png in IE 6- will work below IE 5.5 or in any IE browser with either javascript and/or certain Active X options disabled.

And further - though the various methods for fixing IE 6- png are generally quite effective, sometimes certain png images will either:

Slip through the cracks.

or:

Not be rendered properly.

When this happens, either the markup of the page and/or the code used to render the alpha channel of the png image(s) in IE 6- must be adapted to the specific situation.