issue with png transparency IE8

some place to talk about things

issue with png transparency IE8

Postby pnet on Wed Aug 05, 2009 3:47 am

Hi,

While most PNG alpha issues are with versions before IE7, I am facing an issue with IE8 and a 32-bit PNG file (or even 8-bit) that contains alpha. The screenshot attached
blackborder.png
blackborder.png (3.03 KiB) Viewed 5341 times
shows the black outline for a hover-on menu item when tested in IE8. I've also attached the actual PNG image for your reference
mega_bg_hosting.png
mega_bg_hosting.png (2.07 KiB) Viewed 5322 times
. The relevant CSS is as follows:

  1. #subMenusContainer ul#hosting {
  2.         width: 486px;
  3.         height: 225px;
  4.         background: transparent url("../images/menu/mega_bg_hosting.png") no-repeat 0 0;
  5.          z-index: 500;
  6.         }


The relevant HTML section:

  1.  
  2. <li id="hosting"><a href="#">Anabantoidei</a>
  3.      <ul id="hosting">
  4.           <div>
  5.                  <a href="BUSINESS">Business</a><br />
  6.         <a href="INVITATION">Social &amp; Invitation</a><br />
  7.         <a href="SHIPPING">Shipping &amp; Packaging</a><br />
  8.         <a href="MOST_POPULAR">Most Popular</a>
  9.         </div>
  10.     </ul>
  11. </li>
  12.        


The PNG works fine in Firefox, but shows the ugly black outline in IE8. I tried everything, from using the "filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='images/menu/mega_bg_hosting.png');" CSS style, to the FixPNG javascript from clientcide.com (it only works for IE6 and below, so can't see any results for IE8) and others. I don't know how to fix this at all, and I suspect it's because of the fact that the background-image is being used during hover state, unlike most conventional uses.

Any ideas how to fix this? Thanks for any help!

-pnet
pnet
 
Posts: 1
Joined: Wed Aug 05, 2009 3:35 am

Re: issue with png transparency IE8

Postby Fli7e on Thu Aug 20, 2009 1:30 pm

Well, the problem itself is that MSIE applies the alpha channel to a virtual backgroundcolor if not set or set to transparent (whyever this evil engine is about) ...

I know this is not a fix but just some information about the reason.

Maybe you could try to add this meta tag to bypass the IE8 behaviour:

  1. <meta http-equiv="X-UA-Compatible" content="IE=7">


Other than this .. i never came across a good solution - maybe using MSIE behaviours ...
Whenever you are asked if you can do a job, tell "em, "Certainly I can!" ? and get busy and find out how to do it."
User avatar
Fli7e
mootools connoisseurs
 
Posts: 38
Joined: Fri Mar 06, 2009 7:12 pm
Location: Germany

Re: issue with png transparency IE8

Postby keif on Wed Aug 26, 2009 4:04 pm

Is your PNG on top of a solid color background? If so, add that background color to the background of your PNG (so not "transparent" but "#fff" or whatever).

This has been an issue with IE for awhile - sadly, a set background color seems to be the only fix.
-keif
blog
keif
mootools fan
 
Posts: 58
Joined: Wed Jul 16, 2008 5:18 am
Location: Columbus, OH


Return to Discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron