Icon: News & Updates News & Updates
We've upgraded our Google Docs Toolbar Button to work properly with Google Account Authentication.
Following the success of cheddarvision.tv, Isotope have helped West Country Farmhouse Cheesemakers in the quest for the perfect cheese sandwich with cheddarometer.com.
Icon: Clients & Partners Clients & Partners

News & Articles

PNG fix and Google Maps

Problem with PNG for IE and Google Maps (GMap's) API.

Further to posting my article Definitive IE PNG Fix I have discovered a potential problem which involves the Google Maps API. The problem is that the Google Map won't render in Internet Explorer 6 or 7 if you use the PNG fix in the "wrong" way.

The original post detailed how to attach a CSS behaviour to img tags to script the browser into correctly rendering PNG's. I also suggested that it was possible to attach the behaviour to other HTML tags such as div's and ul's:

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

Whilst this an excellent solution for saving time it causes problems for the Google Maps API in Internet Explorer as the map is enclosed within a <div> tag. As the API automatically deals with IE's inability to render PNG images, there is a conflict between the .htc behaviour and the Google Map's javascript. This results in the Google Maps failing to render correctly in Internet Explorer 6 and 7.

The solution is simple. Just assign the .htc behaviour to a class, and then add that class to each element you need a PNG fix for.

.png-fix {
    behavior: url(iepngfix.htc);
}

Great idea

This is a great suggestion and very helpful.  However, can we include the behavior into an existing class for an image? 

When I attempt to do that, the behavior does not seem to apply to the image.  Any ideas?

Posted by , 24th Jun '08
 

Thanks so much :)

Thanks for taking the time to post this, I've had this exact same issue today and came up clueless until I found this post - it would have probably taken me ages to realise that the PNG fix was the cause!

Posted by G Nutting, 31st May '08