2017-09-26 134 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