PDA

View Full Version : IE6 Hack for Transparent PNG Backgrounds



daemonkin
Jul 10th, 2009, 03:56 PM
Guys,

Looking for some help:
current site: www.inpho.ie

Uses png backgrounds on navigation with a separate .css file for IE6 hacks.

I am trying to recreate this for a new site for the client based on the old style. The problem is that the pngs are not displaying correctly in IE6. The image is there but the transparency is not, instead I am getting a grey outline.

Some of the IE Hack CSS is :



#header #nav ul li.home_btn a.on {
/*background-image: none;*/
width: 58px;
height: 34px;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="../images/home_on_btn.png", sizingMethod="crop");
}


Any help is appreciated getting this to work. Unfortunately I cannot post links to a current dev site as I am developing locally on my machine.

D.

Donkey
Jul 10th, 2009, 04:05 PM
I use this one:
http://www.twinhelix.com/css/iepngfix/

It is easy to use and works with background images and normal images.

daemonkin
Jul 10th, 2009, 04:47 PM
Thanks for that but it doesn't seem to run. I have placed an alert() in the .htc file as shown but it is not being called.

My IE CSS contains:



#header #nav ul li.home_btn a {
behavior: url(../css/iepngfix.htc)
}
#header #nav ul li.home_btn a {
width: 58px;
height: 34px;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='../images/home_off_btn.png', sizingMethod='crop');
}


D.

_Aerospace_Eng_
Jul 10th, 2009, 07:37 PM
You could try using this
http://code.google.com/p/ie7-js/

I don't know if it will work on the rollover's though. It might. Just be sure to read that entire page carefully.

daemonkin
Jul 11th, 2009, 03:04 PM
I have no idea what is happening with IE6 on my virtual machine.

Yesterday in work it would not show the transparancies, last night without any changes to css or file structure the transparancies were good and everything worked.

Today the same css and it did not work. I added a background-image: none; to all backgrounds and it is working.

Bloody MSIE!

Seems that filter: Alpha and background-image; none was all I needed. For now.

D.