Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css IE6 PNG透明度修复,背景定位_Css_Internet Explorer 6_Png Transparency - Fatal编程技术网

Css IE6 PNG透明度修复,背景定位

Css IE6 PNG透明度修复,背景定位,css,internet-explorer-6,png-transparency,Css,Internet Explorer 6,Png Transparency,我用它来修复IE6中背景图像的PNG透明度 ul li a { background-image: url('/NewSite/Content/Images/Sprite.png'); background-repeat: no-repeat; background-position: 0 -48px; background-image: none; filter: progid:DXImageTransform.Microsoft.AlphaImageL

我用它来修复IE6中背景图像的PNG透明度

ul li a
{
    background-image: url('/NewSite/Content/Images/Sprite.png');
    background-repeat: no-repeat;
    background-position: 0 -48px;
    background-image: none;
    filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src=/NewSite/Content/Images/Sprite.png, sizingMethod='crop');
}
这非常有效,但是我在尝试使用sprite实现时遇到了一个问题。该修复将忽略定位,并将该位置渲染为右上角


有没有一种方法可以强制背景位置,或者更好的方法。我不希望使用JavaScript或更改为GIF。

AFAIK做你想做的事情的唯一方法是使用
您必须使用JavaScript,但您可以像我一样在条件注释下扭曲它

<!--[if lt IE 7]>
    <link rel="stylesheet" href="css/ie6.css" type="text/css" />
    <script type="text/javascript" src="js/iepngfix_tilebg.js"></script>
<![endif]-->

这是我公认的答案,但我必须能够在没有JavaScript的情况下执行。最后,我扔掉了精灵,用我的方法处理了单个图像。然而,它工作得很好,所以这是提示。
ul li a { behavior: url(iepngfix.htc); }