John
John

Reputation:

ie6 png transparent not working

<img src="/images/home-1a.png" id ="tab66"  alt="home" />

#tab66 {
 margin-left:0px;
 filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(...);
}

This is my code of png image in ie6 but still it does not show transparency

Upvotes: 0

Views: 266

Answers (3)

RAN
RAN

Reputation: 11

body{ background: #0D657B;}
.png_hack {
  margin:0 auto;
  width:400px;
  height:100px;
  background-image: url(Img/png.png) !important;
  background-image: none;
  filter: none !important;
  filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='Img/png.png');
}

it's works http://www.newstyleonline.net/post/ie6-png-hack.html

Upvotes: 1

Razor
Razor

Reputation: 29588

That is because AlphaImageLoader works like background-image, showing behind the image inside the img tag - the most common trick here is replacing src="/images/home-1a.png" with a 1x1 pixels transparent gif.

A quicker solution for you here would be:

<div id="tab66"></div>

#tab66 {
 margin-left:0px;
 filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(...);
 width: Xpx;
 height: Ypx;
}

if you want to automate this, I'd recommend instead DD_belatedPNG.

Upvotes: 0

NullUserException
NullUserException

Reputation: 85458

Try this jQuery plugin: http://allinthehead.com/retro/338/supersleight-jquery-plugin

That said you should avoid having to use this hack in the first place.
Use .GIF's unless you really have to use PNG

Upvotes: 1

Related Questions