2017-09-26 153 views
0

当一个链接或按钮都存在框阴影和背景颜色时,IE会在其周围显示一条白线。任何想法是什么?边框半径和背景颜色的IE CSS样式

除了以下使用的以外,没有其他样式。我检查了IE11和Chrome的调试器工具。 它不会发生轮廓和背景颜色,只是盒阴影和背景颜色。

JSFiddle here(待上IE运行,使用IE 10)

enter image description here

//css 
a,button { 
    background-color: #61C250 !important; 
    color: white !important; 
    border-color: transparent !important; 
    outline: 0 !important; 
    box-shadow: 0 0 0px 2px #61C250 !important; 
    text-decoration: none; 
} 


//html 
<a href="#/random">Random Link</a> 
<hr/> 
<button>Random Button</button> 
+0

无法在IE10复制为Windows 8或10 –

+0

煤矿是IE11为Windows 8。它也应该发生在IE10中 – wallop

+0

我可以在Windows 8.1中的IE11中重现它;这是在VirtualBox上。 –

回答

1

1E示出了在其周围的白线。任何想法是什么?

这似乎是IE中的一个错误,其中元素边缘的抗混叠效果会从其背后的元素中拾取颜色。

如果设置了body的背景为红色,白线变成红色

body { background: red; } 
 
a,button { 
 
    background-color: #61C250 !important; 
 
    color: white !important; 
 
    border-color: transparent !important; 
 
    outline: 0 !important; 
 
    box-shadow: 0 0 0px 2px #61C250 !important; 
 
    text-decoration: none; 
 
}
<a href="#/random">Random Link</a> 
 
<hr/> 
 
<button>Random Button</button>

+1

我初步认为它可能是因为我使用边框颜色:透明,但即使设置边框:0px固体透明/红色/绿色它出现。谢谢(你的)信息。 – wallop

相关问题