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

前端 未结 6 986
你的背包
你的背包 2021-02-05 21:24

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.

6条回答
  •  囚心锁ツ
    2021-02-05 22:02

    When the background is static I use TweakPNG to change the Background Color chunk in the PNG to the correct color (instead of the default gray color). Any regular browser will ignore this because the alpha channel overrules it, but IE6 and lower will use that color instead of the alpha channel.

    This means we have transparency in IE7+ while degrading nicely in IE6 and lower. And all css positioning and repeating are possible (because there are no hacks!).

提交回复
热议问题