png logo will have white borders on IE9

2019-03-04 17:07发布

I am working on an asp.net mvc web application, we have our upper top navigation bar as blue area, and I am displaying our logo inside the blue area , using the following code:-

   <a class="brand" href="~/Home/Index/"> <img alt="Group" src="~/Content/logo_CMYK.png" /> </a>

but on IE9 it will show white boarder around the logo as follow:-

enter image description here

while on IE10, Firefox and Chrome , logo will have blue boarder as follow, and will work fine :-

enter image description here

can anyone advice how I can fix this layout issue ? Thanks

Edit Here is the CSS retrived from the IE F12:- enter image description here

1条回答
闹够了就滚
2楼-- · 2019-03-04 17:32

This isn't a white border, it's the background which is white. You may try this code:

a, img {
   background: transparent;   
   zoom: 1;
}

It declares that the background of your image is transparent.

If you could set up a jsbin.com example, someone might just show the correct answer instead of guessing a fix.

查看更多
登录 后发表回答