Favorite IE6 PNG hack?

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 20th, 2008, 9:22 am

anyone have a favorite? I need one that works for bg images as well as regular IMG tags.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 20th, 2008, 9:22 am

  • jameson5555
  • Bronze Robot
  • Bronze Member
  • User avatar
  • Joined: Oct 02, 2007
  • Posts: 575
  • Loc: Phoenix, AZ
  • Status: Offline

Post June 20th, 2008, 9:51 am

I always use the iepngfix, but I haven't been able to make it work for background images.

Just waiting for ie6 to die a slow, painful death before I bust out the really tricky CSS moves. 8)
phoenix web design
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post June 20th, 2008, 10:06 am

A conditional comment that tells IE6 not to use the PNG version of a background image, with a GIF version of the image defined beforehand.

Code: [ Select ]
.classname
{
   background: url('image.gif');
}
</style>
<!-- or defined via style.css -->
 
<!--[if gte IE 7]>
<style type="text/csss">
.classname
{
   background: url('image.png');
}
</style>
<![endif]-->
  1. .classname
  2. {
  3.    background: url('image.gif');
  4. }
  5. </style>
  6. <!-- or defined via style.css -->
  7.  
  8. <!--[if gte IE 7]>
  9. <style type="text/csss">
  10. .classname
  11. {
  12.    background: url('image.png');
  13. }
  14. </style>
  15. <![endif]-->


As for images themselves, search real quick to see it there's been any new developments on technique then go with the first solid looking one.

Been awhile since I've done anything where it would matter though. :|
Strong with this one, the sudo is.
  • crazzyDemon
  • Beginner
  • Beginner
  • User avatar
  • Joined: Feb 01, 2007
  • Posts: 55
  • Status: Offline

Post June 20th, 2008, 10:07 am

Usually i use this method
http://homepage.ntlworld.com/bobosola/

but id does not work for background image =(
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 20th, 2008, 10:31 am

yeah I had a javascript one that I built but it doesn't do backgrounds either. I plugged this one into my site but it doesn't seem to have any affect what so ever. Hence the question about what other people are using...
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post June 20th, 2008, 10:41 am

Check this out

http://www.civicactions.com/blog/png_im ... eming_hell
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • HongKongPhooey
  • Student
  • Student
  • User avatar
  • Joined: Sep 01, 2004
  • Posts: 86
  • Loc: Liverpool
  • Status: Offline

Post June 26th, 2008, 3:31 am

graphixboy wrote:
yeah I had a javascript one that I built but it doesn't do backgrounds either. I plugged this one into my site but it doesn't seem to have any affect what so ever. Hence the question about what other people are using...


Did you ever get this problem sorted?

The "fix" you mention in your post definitely works ... I've just finished implementing it into a new design and it works a treat.

If you need any help, let me know. 8)
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 26th, 2008, 5:52 am

Nope I haven't gotten it fixed yet. Although admittedly I haven't had much time to spend on it. I've used several different fixes on other sites and can't figure out why this one doesn't seem to work.

The site in question is http://whenimnotsleeping.com. Feel free to take a look. I assume the issue is simply a path thing, but I have a lot of other JS in there so something might be conflicting with the page load functions...
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • HongKongPhooey
  • Student
  • Student
  • User avatar
  • Joined: Sep 01, 2004
  • Posts: 86
  • Loc: Liverpool
  • Status: Offline

Post June 26th, 2008, 6:06 am

Just a couple of quick lunchtime thoughts ...

Is the "iepngfix.htc" file in the root of your site (or at least in the same folder as the homepage)?

It's referenced in your IE6 stylesheet as being in the same folder as the html page. I tried to access it and got a 404 error, but there could be other reasons for this.

Also, I found out that "the fix" plays up with relatively and absolutely positioned elements. I had to remove the 'position' declaration and resort to floats to get mine to work correctly.

I hope something helps ... if not I'll take another look when I've got a bit more time. :)
  • jameson5555
  • Bronze Robot
  • Bronze Member
  • User avatar
  • Joined: Oct 02, 2007
  • Posts: 575
  • Loc: Phoenix, AZ
  • Status: Offline

Post June 26th, 2008, 7:09 am

HongKongPhooey wrote:
Also, I found out that "the fix" plays up with relatively and absolutely positioned elements. I had to remove the 'position' declaration and resort to floats to get mine to work correctly.

I didn't know that.. maybe that's why I wasn't able to get it to work for background images on my sites.

Also, it's worth mentioning that the guy who wrote the iepngfix is really helpful. When I was first trying to figure it out, I asked some questions on his message board and he helped me figure out what I was doing wrong.
phoenix web design
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 27th, 2008, 9:35 am

HongKongPhooey wrote:
Is the "iepngfix.htc" file in the root of your site (or at least in the same folder as the homepage)?

... probably not at the moment. I was thinking it might be a path issue so I moved it around trying to get something to happen.

However, I think your onto something with the positioned elements. Unfortunately my layout requires that so I'm going to have to find a work around. Maybe its time to contact the author (thanks for the tip jameson)
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post June 27th, 2008, 12:49 pm

Thanks for the help all. Its resolved. Turns out I'm an Idiot :-) My IE 6 only stylesheet (that contained the PNG fix call) wasn't actually loading since I didn't close the if statement correctly.

Once I fixed the if statement and the png fix actually loaded I did have to mess with backgrounds and absolute positioning a little bit by removing png's in a few places.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • HongKongPhooey
  • Student
  • Student
  • User avatar
  • Joined: Sep 01, 2004
  • Posts: 86
  • Loc: Liverpool
  • Status: Offline

Post June 27th, 2008, 2:51 pm

Good to hear you've got it sorted.

Post Information

  • Total Posts in this topic: 13 posts
  • Users browsing this forum: No registered users and 174 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.