PNG Alpha Transparency in IE
IE doesn't care about black people.
Well, maybe that's not fair. But it certianly doesn't care about semi-opaque people.
Among the massive oversights and rendering faux pas Internet Explorer has forced upon us lo these past years, it's inexplicable lack of support for PNG alpha transparency has proven itself among the most frustrating. Realizing their mistake, Microsoft took a very Microsoft approach to the problem and... worsened it. They added to their library of proprietary 'Visual Filters' a technique to replicate alpha transparency, which everyone else was supporting natively. Without going into great detail on why the visual filters scheme is Just Plain Wrong, I will admit that they work, however poorly.
The filter in question is actually a rendering routine or "Procedural Surface" called AlphaImageLoader. What does it do? It makes PNGs work the way they do in other browsers. It's sloppy to implement, but transparent (ha ha) to the user. I'm geussing that the main reason people are reluctant to use this filter is that they assume it will require JavaScript browser sniffing or alternate stylesheets. I believe the following block of CSS does it's own browser filtering and will give the desired effect without JavaScript or excess markup:
The first property sets the background to a PNG image. This will be read by all browsers and the PNG will show up correctly in browsers which supoprt it.
The second property is visible only to IE browsers, due to the underscore preceeding it. Non-IE browsers should ignore it. IE will read the property, and it will override the preceeding property, setting the background to none.
The third property is the filter property, which only IE4+ browsers will read. That big long path references code embedded in the IE rendering engine and runs the routine which re-evaluates how to display the image it's loading. The method can take several agruments, but for our purposes, we've only rovided it with a path to the image.
I haven't tested this fully with Safari , Opera, or any less typical browsers, but I imagine that if this doesn't work, it would be a relatively simple adjustment. Otherwise, this should provide you with a simple, relatively clean way to display PNGs with alpha transparency in all modern browsers and IE.
Or you could just redirect IE visitors here.




Comments
what? what??? oh yeah.... yyyyeeeeaaaahhhhhh....
double a
September 16, 2005 05:33 PM
When I read this kind of thing, it does for me what hearing a man speak in a sexy foreign language (like French, or Italian, or something) does for other women.
Should I be concerned?
Helena
September 19, 2005 12:12 PM
yes helena, yes you should.
micki
September 19, 2005 01:05 PM
i can't believe i've been blind to this for so long. to think it's been going on in our own back cyberspace without us knowing about it. it makes me sick. just sick.
kim
September 21, 2005 12:32 PM
Now, there are two things I could do here. I could recognize that my audience obviously doesn't care about my recent topics, and I could adjust my writing to better accomodate them...
...or I could resign myself to have a grand total of 8 eyes on each article I write and a string of nonsensical and unrelated comments attached to each.
What to do... what to do...
jason
September 22, 2005 02:34 PM
Hmm... I used the method described at alistapart.com (with javascript browser detection etc.) for adifferentworld.net -- is there something I'm missing, or is all of that javascript actually redundant given this solution?
Matthew Huebert
October 23, 2005 01:36 PM
It's great combined with wonditionnal comments : http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/ccomment_ovw.asp
Olivier G.
February 9, 2006 06:04 AM
truck fuck fuck with dre day
Orookwid
October 1, 2006 05:24 AM
truck fuck fuck with dre day
Orookwid
October 1, 2006 05:25 AM
truck fuck fuck with dre day
Orookwid
October 1, 2006 05:25 AM
nrxshdk
Arnold Peyton
October 31, 2006 11:28 PM
duocs
Sam Toney
November 1, 2006 05:00 AM
duocs
Sam Toney
November 1, 2006 05:00 AM
young non nude models young beavers Pop trio Atomic Kitten will reform to play a concert in support of jailed Liverpool football fan Michael Shields...
Joan Villegas
November 3, 2006 07:37 PM
young non nude models young beavers Pop trio Atomic Kitten will reform to play a concert in support of jailed Liverpool football fan Michael Shields...
Joan Villegas
November 3, 2006 07:39 PM
Classical singer Russell Watson postpones his forthcoming UK tour after undergoing brain surgery...
Donte Vanburen
November 16, 2006 09:52 PM
Classical singer Russell Watson postpones his forthcoming UK tour after undergoing brain surgery...
Donte Vanburen
November 16, 2006 09:56 PM
Classical singer Russell Watson postpones his forthcoming UK tour after undergoing brain surgery...
Kristopher Macon
November 22, 2006 03:16 AM
Microsoft and Peter Jackson postpone the making of a film based on the Halo video game after backers pull out...
Bruno Denton
November 22, 2006 04:52 AM
Microsoft and Peter Jackson postpone the making of a film based on the Halo video game after backers pull out...
Bruno Denton
November 22, 2006 04:52 AM
William Styron, whose Holocaust novel Sophie's Choice became a film and an opera, has died, aged 81...
George Cline
November 22, 2006 05:03 PM
William Styron, whose Holocaust novel Sophie's Choice became a film and an opera, has died, aged 81...
George Cline
November 22, 2006 05:04 PM
Jonathan Ross is dubbed "risque" by Ofcom but not in breach of rules over an interview with David Cameron...
Felix Dube
November 22, 2006 09:55 PM
Jonathan Ross is dubbed "risque" by Ofcom but not in breach of rules over an interview with David Cameron...
Felix Dube
November 22, 2006 09:55 PM
Classical singer Russell Watson postpones his forthcoming UK tour after undergoing brain surgery...
Mark Boston
November 22, 2006 11:28 PM
Alec Baldwin asks for his voice to be removed from an "unfair" documentary about Arnold Schwarzenegger...
Michael Stine
November 23, 2006 04:37 AM
Alec Baldwin asks for his voice to be removed from an "unfair" documentary about Arnold Schwarzenegger...
Michael Stine
November 23, 2006 05:24 AM
Alec Baldwin asks for his voice to be removed from an "unfair" documentary about Arnold Schwarzenegger...
Nigel Carvalho
November 24, 2006 12:01 AM
Alec Baldwin asks for his voice to be removed from an "unfair" documentary about Arnold Schwarzenegger...
Nigel Carvalho
November 24, 2006 12:02 AM
The first stage of a £150m investment in regional museums is praised for boosting visitor numbers...
Trey Mcadams
November 26, 2006 01:06 AM
The first stage of a £150m investment in regional museums is praised for boosting visitor numbers...
Trey Mcadams
November 26, 2006 01:07 AM
Leave a Comment