盒子阴影在IE8的压缩版本的CSS中不起作用?

时间:2014-01-30 09:07:47

标签: css html5 internet-explorer-8 css3

我有一张图片,其中在悬停时我应用了boxshadow的CSS。对于IE8我正在使用过滤器,它工作正常,但当我压缩我的CSS它停止工作。 这是正常的CSS:

.lt-ie9 .myimage:hover{
filter:progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=0,strength=1),
          progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=45,strength=1),
          progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=90,strength=2),
          progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=3),
          progid:DXImageTransform.Microsoft.Shadow(color=#cccccc,direction=180,strength=10),
          progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=225,strength=3),
          progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=270,strength=2),
          progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=315,strength=1);
zoom:1;
background-color:rgb(255, 255, 255);}

这里是压缩的css:

.lt-ie9 .myimage:hover{
filter:progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=0,strength=1),progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=45,strength=1),progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=90,strength=2),progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=135,strength=3),progid:DXImageTransform.Microsoft.Shadow(color=#cccccc,direction=180,strength=10),progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=225,strength=3),progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=270,strength=2),progid:DXImageTransform.Microsoft.Shadow(color=#dddddd,direction=315,strength=1);
zoom:1;
background-color:rgb(255, 255, 255);
}

任何人都能告诉我它背后的解决方案和原因是什么

1 个答案:

答案 0 :(得分:0)

逗号被忽略。您需要一个空格或换行符来粘贴多个过滤器。

progid:xxx progid:yyy / works

progid:xxx,progid:yyy / works

的progid:XXX progid:yyy / works

progid:xxx,progid:yyy /将无效

这将是正确的

.lt-ie9 .image-with-align:hover{background-color:#fff;zoom:1;filter:progid:DXImageTransform.Microsoft.Shadow(color=#ddddd9,direction=0,strength=1) progid:DXImageTransform.Microsoft.Shadow(color=#ddddd9,direction=45,strength=1) progid:DXImageTransform.Microsoft.Shadow(color=#ddddd9,direction=90,strength=2) progid:DXImageTransform.Microsoft.Shadow(color=#ddddd9,direction=135,strength=3) progid:DXImageTransform.Microsoft.Shadow(color=#ccccc9,direction=180,strength=10) progid:DXImageTransform.Microsoft.Shadow(color=#ddddd9,direction=225,strength=3) progid:DXImageTransform.Microsoft.Shadow(color=#ddddd9,direction=270,strength=2) progid:DXImageTransform.Microsoft.Shadow(color=#ddddd9,direction=315,strength=1)}