2016-12-05 55 views
0

我在IE環境中有一個樣式問題。當我使用border-radius創建一個div圓時,圓形div的邊框並不平滑,如chrome或firefox所示。IE:邊框半徑與背景不平滑

以下是代碼,我使用

HTML

<div class="col-sm-4"> 
    <div class="circle-images"></div> 
</div> 

CSS

填充頂:60%,使得格方,當你把背景圖像。

.circle-images{ 
    width:60%; 
    padding-top:60%; 
    border-radius: 60%; 
    margin-right: auto; 
    margin-left: auto; 
    background: url("some/path/to/jpg") no-repeat center center; 
    background-size:contain; 
} 

我也試過這種風格。邊界比沒有邊界時的邊界更平滑一些,但邊界有很多噪音。

.circle-images{ 
    width: 60%; 
    padding-top:50%; 
    border-radius: 60%; 
    border: 27px solid #EAEAE4; 
    margin-right:auto; 
    margin-left:auto; 
    background: url("some/path/to/jpg") no-repeat center center; 
    background-size:contain; 
} 

有沒有什麼辦法讓邊界在IE中像Chrome一樣流暢?

**更新** 由於@LGSon問樣本圖像,這裏是發生了什麼

IE noises

+0

什麼是IE的版本? – epascarello

+0

我使用邊緣,但我想支持高達ie8和模擬器邊緣ie 8也顯示噪音:( –

+0

我檢查了IE11-9,你說什麼噪音?...你有一個圖像顯示它? – LGSon

回答

0

這是IE瀏覽器的bug。最安全的方式(但不是最簡單的方法)是使圖像自行循環。另一個解決方案是嘗試使用瀏覽器特定的黑客,但這是非常不安全的。

如果可能,我建議轉換爲像PNG這樣的允許透明度的圖像結構,然後讓圖像呈圓形。