Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ajax/6.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 透明背景问题IE8、IE7_Css_Internet Explorer 8_Internet Explorer 7_Png_Background Image - Fatal编程技术网

Css 透明背景问题IE8、IE7

Css 透明背景问题IE8、IE7,css,internet-explorer-8,internet-explorer-7,png,background-image,Css,Internet Explorer 8,Internet Explorer 7,Png,Background Image,为我的菜单使用图标(.png透明背景)。IE9、Chrome、Firefox、safari、opera没有任何问题,但如果我用IE7或IE8打开页面,图像周围会有一个破损的黑色边框。CSS代码 .menu-item1{ background:url(img/spriteimage.png) no-repeat 0 0; height:20px; width:20px; opacity:0.5; } 我怎样才能解决这个问题 IE7和IE8对alpha透明胶片具有本机PNG支持

为我的菜单使用图标(.png透明背景)。IE9、Chrome、Firefox、safari、opera没有任何问题,但如果我用IE7或IE8打开页面,图像周围会有一个破损的黑色边框。CSS代码

.menu-item1{
  background:url(img/spriteimage.png) no-repeat 0 0;
  height:20px;
  width:20px;
  opacity:0.5;
 } 

我怎样才能解决这个问题

IE7和IE8对alpha透明胶片具有本机PNG支持,但一旦不透明度进入图片,它就会崩溃

尝试伪造背景图像或将其设置为blank.gif,而不是使其透明

 background:url(blank.gif);

 /* IE 8 */
 -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";

  /* IE 7 */
  filter: alpha(opacity=50);