IE6 PNG support

Posted by Rob CornishPostMarch 24, 2008Date

Using Angus Turnbull's iepngfix.htc you can add png support to IE6.

In order to make this work, you also need the blank.gif image.
Open up the iepngfix.htc in your favourite text editor and make sure the path to blank.gif is correct.

Within the css document add the following behavior:

img, div { behavior:url(iepngfix.htc); }

On using this, I've noticed that you need to add a width and height on the image for it to display correctly.

Playing with links, I ran into a few problems…
The main one being a background png called in via the css with links on top. The links were there but unclickable, I found out that the background cannot use positioning. By placing this in a containing div with the positioning on solved this problem.

On looking into the linking situation further I came across a simpler solution.
Simply by adding:

a { position:relative; z-index:1000; }

This forced the links in front of the PNG graphics.

Using the PNG as a background comes with a few issues, in IE6 you cannot use background-position or background-repeat. The attached PNG fix allows you to stretch the PNG graphic for repeating backgrounds. As long as you specify a width to this element it will work. The positioning has no work around, IE6 will completely ignore any input from this style. A work around I have used is that you place the PNG image within a div, positioned absolute behind the content div.

Please let me know if you find better ways on using this!


4 Comments »

  1. Thanks, fixed the problem for me, stupid ie6!

    Comment by Defect — September 17, 2008 @ 2:58 am

  2. There is no magic skill.

    Comment by Inara — November 5, 2008 @ 7:55 pm

  3. I used this fix and it worked very well but another problem came with it. The scrolls won't work in IE 6.0. In IE 7, everything works well. Do somebody knows how to fix that little problem?

    Comment by Melissa — November 21, 2008 @ 8:17 am

  4. Thanks , Indeed

    Comment by Sherif — August 31, 2009 @ 9:21 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Tags
Flickr
SelfDSC_0207DSC_0206DSC_0205
© 2008 dlnqnt - Admin - Login