Click to See Complete Forum and Search --> : transparence in PNG images
zerooito
07-15-2003, 03:14 PM
Hi folks!
I´m trying to use a transparent PNG file inserted a DIV.
so, I expected that the stuff under that div would be
visible, but it´s not.
Actually, I was trying to make an image that
would be used in various colors, just changing the background of the div, instead of creating
multiples images with different colors.
<DIV ID="barra" STYLE="background-color:'#00ff00'">
<a href="" <IMG border=0 name=imgAA src=".\images\bt_novo_out.png"></a></TD>
</DIV>
I am using the attached image, with no success.
What´s wrong?
Thanx in advance!
Zerooito
David Harrison
07-15-2003, 04:15 PM
I had a look at the image however I can't see any transparency. Nevertheless I did see your code and I noticed this:
<DIV ID="barra" STYLE="background-color:'#00ff00'">
I don't think that those single quotes should be there, so the line should be:
<DIV ID="barra" STYLE="background-color:#00ff00">
Also, I hope that this isn't in your code :(:
<a href="" <IMG ...
zerooito
07-15-2003, 04:46 PM
Hmmm...
I tried to click at the link for the image in this post,
and it opened a page showing he image in quickTime.
(very strange)
but believe in me:
the image contains alpha information.
and about the DIV thing, never mind...
I´m using Microsoft Interdev, and it works
with or without the quotes on bgcolor.
I just remover the href string for this stuff,
because it´s a long string. Nobody needs to see it.
that´s why the href="".
I´m wondering about the image transparence,
because it becomes a grayscale gradient, instead
of the transparent gradient that I was expecting.
Thanx for replying.
Zerooito
Jeff Mott
07-15-2003, 06:16 PM
and about the DIV thing, never mind...
I´m using Microsoft Interdev, and it works
with or without the quotes on bgcolor.Are you referring to this DIV thing?
<DIV ID="barra" STYLE="background-color:'#00ff00'">
If so then lavalamp is correct. The single quotes should *not* be there. The fact that it may still work is sheer chance that the browser could still figure out what you meant. But this error correction behaviour is not guarenteed to be the same from one browser to another, or even one browser's version to another. Better to do it the correct way.
And for the reason why your image is not appearing transparent. The reason is because you are probably browsing with Microsoft's browser. Despite having the most resources, Microsoft always seems to be the last to get their software working correctly (if ever). Both Netscape (Mozilla) and Opera support your image's transparency perfectly.
zerooito
07-15-2003, 06:29 PM
Hmmm...
thanx, folk!
I understand it now, by that you´re saying.
The matter is the microsoft interdev doesn´t
point to the quotes on the color atribution as an error.
and it works nice on IE... but if you´re saying that
it won´t work on other browser, I´ll believe in you.
I´ve changed my mind using the PNG for transparence.
I´ll do it by coding DHTML alpha filter.
I´m trying it now to see what´ll happen.
But in fact, I´m a little disappointed with IE.
Thanx for your answer!
Zerooito
zerooito
07-15-2003, 11:04 PM
Yurk!
It was a terrible vision!...
Damn it!
The result using the alpha effect from DHTML was too ugly.
I'd better use another solution for this thing.
tsc... tsc...
Macromedia Flash is too easy.
:-)
Thanx for the help!
Zerooito