The answer is yes and no, for Internet Explorer supporting alpha transparent PNGs. Here's a hack to get it to work:
Code:
/* This would be your normal CSS file, viewable by Internet Explorer and
* non-IE browsers. */
#someDIV {
background: transparent url(path/to/bg.png) repeat-y scroll 0 0;
}
The above code will get things to work for Gecko (Firefox, Mozilla, Netscape 7+, etc), KHTML (Safari, Omniweb, etc) and Trident (Internet Explorer 7 only) browsers. Gecko, KHTML and Trident are the three main browser rendering engines used today. To get alpha transparent PNGs to work with IE 5.5 and 6 (which use an older version of the Trident rendering engine), you need a little bit of, shall we say... coercion. Insert the following snippet of code into the HEAD of every HTML document in which you want 24-bit transparent PNGs:
HTML Code:
<!--[if IE]>
<style type="text/css" media="screen">
@import "/css/Fix_Internet_Explorer.css";
</style>
<![endif]-->
Now in the aptly named Fix_Internet_Explorer.css file:
Code:
/* IE7 does not support the star-html hack anymore, so this is ignored by IE7: */
* html #someDIV {
background: transparent none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='path/to/bg.png',sizingMethod='scale');
}
And that's it.
Also note that the URL in AlphaImageLoader(src='...') I've found to be relative to the HTML document that calls the style sheet, rather than relative to the stylesheet that has the filter: CSS property. Another snagging point is that Internet Explorer will shrink or crop the HTML element's boundries to fit the image loaded using the AlphaImageLoader. You can also cause the background image to stretch to the boundries of its containing HTML tag.
Here's more about the AlphImageLoader at the Microsoft Developers Network:
http://msdn.microsoft.com/library/de.../reference.asp
BTW absolutmgd13, I like your sig
Very fitting for this case.
Bookmarks