PNG transparency

Do something cool with CMS? Show us ...
This board is for 'Answers', and the discussion of answers... Not for questions.
Post Reply
mr p
New Member
New Member
Posts: 9
Joined: Mon Jan 01, 2007 10:56 pm

PNG transparency

Post by mr p »

Has anyone used the solution given here for PNG transparency http://koivi.com/ie-png-transparency/?

I'd like to use png's in the menu if possible, which the javascript solution doesn't work with (as the images are in css, not html).

Any thoughts?
cyberman

Re: PNG transparency

Post by cyberman »

Have you tried to insert it in index.php?
mr p
New Member
New Member
Posts: 9
Joined: Mon Jan 01, 2007 10:56 pm

Re: PNG transparency

Post by mr p »

I've not tried anything yet, I'm just doing a lot of reading at the moment.  I'm not terribly comfortable with PHP at this stage, so I'm trying to get my head together before trying things.

It says on the page I linked to that it interferes with javascript work arounds, which is partly why I asked if anyone had used it.
heatherfeuer

Re: PNG transparency

Post by heatherfeuer »

I also prefer png image files because I can get alpha channel transparency and 16 million colors.  However, as many know, IE doesn't play well with transparent png files.  I found a fix that works well for me.  I won't swear that it works with png files in CSS because I call the images inside the divs in the templates.

The information about this can be found here: http://homepage.ntlworld.com/bobosola/pnghowto.htm.  The file itself is called pngfix.js.  The code to call it is:

Code: Select all

<!--[if lt IE 7.]>
<__script__ defer type="text/javascript" src="pngfix.js"></__script>
<![endif]-->
Works in IE 6 just as well.
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: PNG transparency

Post by Elijah Lofgren »

It doesn't make sense, but this CSS code seems to work to make PNG's transparent in IE:

Code: Select all

img { behavior: url(iepngfix.htc); }
Hope this helps,

Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
Dee
Power Poster
Power Poster
Posts: 1197
Joined: Sun Mar 19, 2006 8:46 pm

Re: PNG transparency

Post by Dee »

Elijah Lofgren wrote: It doesn't make sense
It makes more sense when iepngfix.htc (and blank.gif) are your css directory.

Regards,
D
User avatar
Elijah Lofgren
Power Poster
Power Poster
Posts: 811
Joined: Mon Apr 24, 2006 1:01 am

Re: PNG transparency

Post by Elijah Lofgren »

Dee wrote:
Elijah Lofgren wrote: It doesn't make sense
It makes more sense when iepngfix.htc (and blank.gif) are your css directory.

Regards,
D
But what's weird is that those files were not and it still worked. :)

- Elijah
Note: I don't have time to take on any more projects. I'm quite busy. I may be too busy to reply to emails or messages. Thanks for your understanding. :)
Post Reply

Return to “Tips and Tricks”