Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a JavaScript PNG fix for IE6 that allows CSS background positioning?

I've seen a few fixes for allowing PNG images to have transparency in Internet Explorer 6, but I've yet to find one that also allows you to set the background position in CSS. If you use sprites, it's a deal-breaker. I've resorted to using GIF's (which are not as high quality), not using transparent images at all, or serving a completely different stylesheet to IE6. Is there a fix for IE6 that allows for PNG transparencies AND background positioning?

like image 845
VirtuosiMedia Avatar asked Sep 17 '08 19:09

VirtuosiMedia


2 Answers

Yes. Convert your images to use indexed pallets (png256). You can support transparency (just like gif), but not an alpha channel.

You can do this using Irfanview and the pngout plugin, pngquant or pngnq.

The YUI performance team also did a great presentation that covers this an many other image optimization concepts.

like image 194
Prestaul Avatar answered Nov 15 '22 11:11

Prestaul


This is a new technique that has popped up in the last month or so. From the page:

In this script image tags are supported, both with and without a blank spacer GIF, and background image PNGs may be positioned, as well as repeated, even if they're smaller than the content element they're in.

like image 37
Tom Avatar answered Nov 15 '22 13:11

Tom