Archive for the ‘Hacks’ Category

Unit PNG Fix Enables Transparent PNG Support in IE6

Wednesday, July 30th, 2008

I just stumbled upon Unit PNG Fix by Unit Interactive. It is one among the many JavaScript based PNG transparency solution for IE6, and is inspired by the SuperSleight solution. What’s good about it though is that it is fully DOM based and automatic. There is no need to assign any additional classes (such is the case with TwinHelix IE PNG Fix) or rename any files (refer to Dean Edwards IE7 fix).

The official website lists the following features:

  • Very compact javascript: Under 1kb!
  • Fixes some interactivity problems caused by IE’s filter attribute.
  • Works on img objects and background-image attributes.
  • Runs automatically. You don’t have to define classes or call functions.
  • Allows for auto width and auto height elements.
  • Super simple to deploy.

Impressed, I gave it a spin. I took one of my projects and replaced the existing TwinHelix PNG Fix code with Unit PNG Fix. It seems to work a charm in all areas except for one: elements with absolute positioning and / or z-index gets screwed up, as can be seen in the following screenshots:

Correct layout using TwinHelix PNG Fix:

This time using Unit PNG Fix:

Here’s the actual CSS code:

h1 a { background: url(images/logo.png) no-repeat; display: block; width: 256px; height: 128px; position: absolute; top: 15px; left: 472px; z-index: 99; }

Other than that, for “normal uses”, Unit is the easiest way to go. The project is only two weeks old, and I have high hopes that bugs like these will eventually be fixed to provide a truly plug and play IE7 PNG transparency solution.

On the same note, the PNG8 format may actually be preferable for low color, non-gradient alpha transparency requirements.

Almost Perfect, CSS-Only, Tableless Forms

Thursday, February 28th, 2008

Easy Drop Caps Lets You Create Drop Caps Without Additional Markup

Friday, February 15th, 2008

Trick To Create Dynamic Gradient Text With CSS And PNG

Saturday, February 9th, 2008

Installing Multiple IE On A Single Machine

Wednesday, November 7th, 2007

Emuate AJAX Image Loading with CSS

Wednesday, September 12th, 2007