views:

333

answers:

6

Hi, I have a website that I need to make some images that are colored, with a 45% opacity, so you can see through to the background. My problem is that for obvious reasons I cannot use a .png. I have used a gif. When I get it on the site, the opacity has read as far as the color, but you cannot see through it. How do I make this happen

EDIT

I don't want to use an IE6 hack if I don't have to. As far as I have tried, there are no scalable hacks.

+9  A: 

GIF does not support alpha transparency. Why is it so obvious that you cannot use PNG?

PNG works in all modern browsers, whereas alpha transparency is not supported in IE6 natively. However, there are many fixes for this available on the good 'ol webernets..

If you absolutely must support "dumb users", force them to use Chrome Frame, the "i'm in ur browser making ur browser another better browser" browser. Chrome Frame is a plugin for IE that renders the page using the Chromium engine from Google.

snicker
I concur. PNG transparency works in all major browsers, it's alpha transparency that doesn't work well in IE6 and there are numerous easy fixes for it.
Nissan Fan
whoa. your comment was the same as my edit. jinx!
snicker
if you are referring to IE6's lack of PNG Alpha transparency support.. there are multiple workarounds for this that will solve 95% of the issues.
scunliffe
all the fixes i have tried have screwed up other things on the site...none of them are suitable for a larger website with a lot of potential transparencies...as they will slow down the loading.
Ralph The Mouf
Then you're SOL. GIFs cannot do what you request.
ceejayoz
Tell your client to stop supporting IE6. http://desizntech.info/2009/02/die-ie6-die-go-to-hell-already/
discorax
haha, i wish i could...but thatd be like telling an ice cream salesman to stop supporting children clients.
Ralph The Mouf
+4  A: 

gif has only 1 bit of opacity, you can't have 45%

Emmanuel Caradec
+2  A: 

Use transparent PNG to gain the full Alpha Channel, and then a fall-back CSS for Internet Explorer 6 that uses GIF, or one of the many workarounds to support transparent PNGs in IE6 (except the "workarounds" using AlphaImageLoader)

Michael Stum
+3  A: 

GIF transparency is either all on, or all off. It does not support partial transparency. PNG however does have partial transparency support. Unless you have a specific requirement to not use PNG images, I see no reason they could not be used.

Shaun Hamman
I can't use PNGs because of IE6...our user-base is highly dumb with browsers. :( ...I'm trying to stay away from hacks because they are sketchy, and often depend on the browser settings anyway (javascript)
Ralph The Mouf
The hacks are not "sketchy", they are functional. IE6 is sketchy. If your users are using IE6 with JS disabled, well, they're probably not having very much fun on the internet these days anyways. And in that case, you can fall back to GIF and tell the user why they have to look at an ugly user interface. Or you can force them to use chrome frame: http://www.google.com/chromeframe
snicker
+1  A: 

As stated above GIF only has 1 bit opacity, meaning On or OFF, nothing in-between. That is the same as 8-bit PNG.

Assuming the reason you can't use .PNG is because you're required to to fall back and work in older version of Internet Explorer. Unforuntately there is no good way to make it work. There are hacks that you can use to get PNGs to work properly in IE6, but if you have to support all the way back to IE5 you're SOL.

discorax
+1  A: 

This article HERE is a must read if you want to be able to use .png with ie6.