Forum Moderators: not2easy
Now, as we all know IE6 and below are a little frustrating when it comes to transparent pngs.
The problem I'm having is that it all works well in all other browsers but when I'm in IE6 there's a grey space where the transparency should be. So, I used this script: [twinhelix.com...] (I also tried the official Microsoft filter in the CSS and the same occurs).
Rather than centering the 500px wide png it seems to be stretching it to either side of the page. Any ideas? Here's my CSS:
html, body
{
background-color: orange;
background-image: url(images/background.png);
background-repeat: repeat-y;
background-position: center 0;
margin-top: 0;
height: 100%;
}
img, body { behavior: url(iepngfix.htc); }
I'm only needing to use it for the background which will repeat vertically so I'm wondering what is the best way and easiest way of solving this issue?
I'm still mostly on the 2nd solution myself, but I'm seriously starting to consider the 3rd for some sites.
There is a 4th: Tell the IE6 users to go away, but I don't really want to consider that. It's what the Microsoft minded webmasters did to the netscape users back in the browser wars, but even then I don't want to play that game.
So a solution to your example would be to blend the transparency with the orange background yourself and give that -non transparent image to IE6 using a conditional comment. (and if you need a version with blue, one with green etc: make many of them ... and let them load images over and over). Or make the background simpler for IE6 and not need transparancy.
I used something called pngfix
It took me a while to figure but i got it working in the end. It uses a file with a .htc file suffix which I think is something that only internet explorer can use. I can't tell you exactly how I got it working now because I'm at work and my files are on my home computer.
It took me a few tries but it does definatly work in ie6. All links clickable, and i'm also pretty sure its javascript free.
I'll post later from home when I've got the files