JUN
2008
02
The PNG hack allows for the alpha channel in .png images to render correctly in IE6.
How
In this example we will be placing a PNG image as a background through CSS. The way this hack functions is through an htc script. You don't need to concern yourself with how the htc file works, just understand that it does. The only extra style that must be applied is the behavior which you can see listed below. Other then calling the <div>, that's all there is to it.
CSS Styles
.container {
behavior: url(iepngfix.htc);
background: url(image.png) top left no-repeat;
width: 215px;
height: 138px;
}
HTML
<div class="container"></div>
If you would like to place the image in the HTML code rather then the CSS then all you need to do is add the img tag to your class or id as you can see below.
CSS Styles
.container img{
behavior: url(iepngfix.htc);
}
HTML
<div class="container"><img src="image.png"></div>
