Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE6 issues with transparent PNGs

I've gotten used to the idea that if I want/need to use alpha-trans PNGs in a cross-browser manner, that I use a background image on a div and then, in IE6-only CSS, mark the background as "none" and include the proper "filter" argument.

Is there another way? A better way? Is there a way to do this with the img tag and not with background images?

like image 508
Steve Paulo Avatar asked Sep 24 '08 21:09

Steve Paulo


People also ask

Why is the PNG not transparent?

Because when you download the PNG from the Previewer Window, the PNG LOSES the transparency information. Which is why I say that, despite DropBox personnel claiming it does not edit the files, it indeed does.

Can PNG be transparent?

png-32 supports different levels of transparency. Each pixel can have an opacity between 0 and 255, with 0 as completely transparent. png-24 supports setting one color as fully transparent. Everything else will be opaque.


1 Answers

The bottom line is, if you want alpha transparency in a PNG, and you want it to work in IE6, then you need to have the AlphaImageLoader filter applied.

Now, there are numerous ways to do it: Browser specific hacks, Conditional Comments, Javascript/JQuery/JLibraryOfChoice element iteration, Server-Side CSS-serving via UserAgent-sniffing...

But all of 'em come down to having the filter applied and the background removed.

like image 124
Pseudo Masochist Avatar answered Sep 24 '22 13:09

Pseudo Masochist