Reply
Mon 2 Aug, 2004 05:49 am
Hello...
I use both IE6 and Opera 7.53. I created a logo with transparent background. In IE6, the image is viewed with grey background, while not seen in Opera.
Would anybody please advise me how to view the image nicely with IE6 (without seeing its grey background).
Your advice would greatly appreciated.
Thank you,
David
Why is the image transparent if you do not want the background seen?
Perhaps he means the background colour of the image itself can be seen. Anyway, I am new here so don't know the rules but can you post this image or a link or something so we can see it??
I too use both those browsers and have no cross-browser issues in regards the situation you describe.
Is the logo image in PNG format? I suspect it is, as IE has absolutely terrible support for PNG - which is an open-source alternative to the proprietary GIF format, with many additional features as well - and doesn't understand alpha transparency in PNG images. If your graphic has alpha transparency (24-bit PNG), IE will show all transparent regions as gray. Try saving in 8-bit PNG instead; 8-bit PNG transparency works the same way GIF transparency does, by setting a single color to be hidden, and works in IE.
Phanx, that makes perfect sense. Variable transparency is one of the big knocks on IE because it doesn't support it. And it will, in fact, cause a grey background. I'd not understood what the author had been asking.
If you can somehow apply the image with CSS (set it as the background for something, for example) you can use alpha transparency all you want, as long as you create a second version without alpha transparency for IE to use. As IE also fails to understand the CSS declaration "!important", you set the 24-bit image first, with an !important declaration, and then set the 8-bit image in a line right after it, without the delcaration. IE, not understanding !important, will obey CSS rules and override the first rule with the second:
background-image: url(file-24.png) !important;
background-image: url(file-8.png);
I do this for quite a few images on my site, although I have to do some fancy coding to get images to load as backgrounds!
There is also a trick to use IE's filter, which does support alpha transparency.
See here:
http://homepage.ntlworld.com/bobosola/pngtestfixed.htm
Thanks for the link, Craven....that's cool.