Home Daily Marketing Tips About Me Work With Me

Marketing & Design Blog

Internet Marketing, SEO, Blogging, Social Media, Lead Generation and Analytics

IE PNG – The PNG Transparency Problem in Windows Internet Explorer

,

As many web developers may already know, several versions of Windows Internet Explorer (IE), cannot properly render PNG image transparencies. There are many CSS hacks and tricks out there to skirt this issue, most often by using less sexy graphics specific for IE browsers.

There is also a lesser known way of fixing the IE problem using a few simple lines of JavaScript.

The only downside to the JavaScript solution is that it only works on <img> elements, and does not work on background images or images placed with a style sheet. Also, the images must have their height and width attributes defined in the HTML.

The following JavaScript code is made available by ntlworld.com:

To use this code, simply call the script to the file in need of the fix and be certain your PNG images have the height and width attributes defined.

That’s it!

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

2 Comments »

  1. This is a fix I’ve used for Transparent Background images:

    if (navigator.platform == "Win32" && navigator.appName ==
            "Microsoft Internet Explorer" && window.attachEvent) {
    	window.attachEvent("onload", alphaBackgrounds);
    }
    
    function alphaBackgrounds(){
    	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
    	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
    	for (i=0; i

    Comment by Chris — August 28, 2006 @ 2:48 pm

  2. [...] An overview of PNG status in different web browsers: Browsers with PNG Support The PNG problem in Windows Internet Explorer IE PNG – The PNG Transparency Problem in Windows Internet Explorer [...]

    Pingback by PNG image format..what is it good for? « interface design for the web — September 26, 2006 @ 7:45 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

logo design brand development

We have simplified the typical logo ordering process, put you in direct contact with the artist, made getting additional branding products and websites easy, and rounded it all off with high quality printing services at fantastic rates... Learn more

website design development

We have made getting a completely dynamic website built on the WordPress content management system with a theme of your choice easy. We integrate your logo into the site design and offer great add-ons at amazing prices - giving you a range of choices on design and layout... Learn more

search engine optimization

We have expert SEO consultants ready to tackle any aspect of your search engine marketing and optimization needs. We take pride in the ability to custom build an Internet marketing campaign that is perfectly suited to your needs.... Read more


© Copyright 2003-2010 Zach Graeve and Expert Online Services, LLC. All Rights Reserved.
 Subscribe, RSS, Comments RSS, XML Sitemap, Privacy Policy