透明背景问题IE8,IE7 [英] transparent background issue IE8, IE7
本文介绍了透明背景问题IE8,IE7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
为我的菜单使用图标(.png透明背景)。 IE9,Chrome,Firefox,safari,opera都没有任何问题。但是如果我用IE7或IE8打开页面,图像周围会出现黑色边框。 CSS代码;
use an icon (.png transparent background) for my menu. There isn't any problem for IE9, Chrome,Firefox,safari,opera.But if I open page with IE7 or IE8 there is a broken black border around image. CSS codes;
.menu-item1{
background:url(img/spriteimage.png) no-repeat 0 0;
height:20px;
width:20px;
opacity:0.5;
}
我该如何解决这个问题?
How can I fix this?
推荐答案
IE7和IE8对alpha透明胶片有原生的PNG支持,但只要不透明度进入画面就会崩溃
IE7 and IE8 have native PNG support for alpha-transparencies, but it falls to pieces as soon as opacity comes into the picture
尝试伪造背景图片或将其设置为blank.gif而不是使其透明。
Try faking a background image or setting it to a blank.gif instead of making it transparent.
background:url(blank.gif);
OR
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
/* IE 7 */
filter: alpha(opacity=50);
这篇关于透明背景问题IE8,IE7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文