IE6 PNG Transparency Fix

I had to use a .png file with alpha transparency on a site which works fine in both IE7 and Firefox 2. However, IE6 does not like it at all. There is a fix out there called pngfix.js which works great if you have an img tag but this was a background image set in the CSS. Here’s what I did:

#wrap {
	margin:0px auto;
	background-image:url('/IMG/wrap_bg.png');
	background-repeat:repeat-y;
}
* html #wrap {
	background-image:none;
	filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/IMG/wrap_bg.png', sizingMethod='scale');
}

This worked like a charm!

Leave a Reply